summaryrefslogtreecommitdiff
path: root/tests/MyGame
diff options
context:
space:
mode:
authorRobert <me@rwinslow.com>2015-05-12 14:53:31 -0700
committerRobert <me@rwinslow.com>2015-05-12 14:53:31 -0700
commit4d213c2d06fa17bec1dc87d16d02b8d94bc4fc58 (patch)
tree9973c5beb1ca6c6d15f410252559884d41d809d1 /tests/MyGame
parent361bfb6764570113422d964f94a86bdad2679388 (diff)
parente5c21ec66685df0b3e113a9e708a2d4458e9d859 (diff)
downloadflatbuffers-4d213c2d06fa17bec1dc87d16d02b8d94bc4fc58.tar.gz
flatbuffers-4d213c2d06fa17bec1dc87d16d02b8d94bc4fc58.tar.bz2
flatbuffers-4d213c2d06fa17bec1dc87d16d02b8d94bc4fc58.zip
Merge pull request #165 from rw/go-faster
Go speed improvements
Diffstat (limited to 'tests/MyGame')
-rw-r--r--tests/MyGame/Example/Monster.go12
-rw-r--r--tests/MyGame/Example/Stat.go6
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/MyGame/Example/Monster.go b/tests/MyGame/Example/Monster.go
index 0a6ba135..a51e4296 100644
--- a/tests/MyGame/Example/Monster.go
+++ b/tests/MyGame/Example/Monster.go
@@ -50,12 +50,12 @@ func (rcv *Monster) Hp() int16 {
return 100
}
-func (rcv *Monster) Name() string {
+func (rcv *Monster) Name() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
if o != 0 {
- return rcv._tab.String(o + rcv._tab.Pos)
+ return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
- return ""
+ return nil
}
func (rcv *Monster) Inventory(j int) byte {
@@ -130,13 +130,13 @@ func (rcv *Monster) Test4Length() int {
return 0
}
-func (rcv *Monster) Testarrayofstring(j int) string {
+func (rcv *Monster) Testarrayofstring(j int) []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(24))
if o != 0 {
a := rcv._tab.Vector(o)
- return rcv._tab.String(a + flatbuffers.UOffsetT(j * 4))
+ return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j * 4))
}
- return ""
+ return nil
}
func (rcv *Monster) TestarrayofstringLength() int {
diff --git a/tests/MyGame/Example/Stat.go b/tests/MyGame/Example/Stat.go
index b2c8e3e1..936d5ec9 100644
--- a/tests/MyGame/Example/Stat.go
+++ b/tests/MyGame/Example/Stat.go
@@ -14,12 +14,12 @@ func (rcv *Stat) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
-func (rcv *Stat) Id() string {
+func (rcv *Stat) Id() []byte {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
- return rcv._tab.String(o + rcv._tab.Pos)
+ return rcv._tab.ByteVector(o + rcv._tab.Pos)
}
- return ""
+ return nil
}
func (rcv *Stat) Val() int64 {