summaryrefslogtreecommitdiff
path: root/xgbgen/go_struct.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-06 03:06:02 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-06 03:06:02 -0400
commitb081fc803a2b33daa0a9f5281c7a84e70df95068 (patch)
treeae80dd2f6bbd6a57074baa0929334b3b15f0acb4 /xgbgen/go_struct.go
parent864eb4f165c20b07fd6ef2a2993aaa39a9714a1a (diff)
more bug fixes for the rest of the extensions
Diffstat (limited to 'xgbgen/go_struct.go')
-rw-r--r--xgbgen/go_struct.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/xgbgen/go_struct.go b/xgbgen/go_struct.go
index 1e43199..9884194 100644
--- a/xgbgen/go_struct.go
+++ b/xgbgen/go_struct.go
@@ -104,7 +104,11 @@ func (s *Struct) WriteListSize(c *Context) {
c.Putln("// Struct list size %s", s.SrcName())
c.Putln("func %sListSize(list []%s) int {", s.SrcName(), s.SrcName())
c.Putln("size := 0")
- c.Putln("for _, item := range list {")
+ if s.Size().Expression.Concrete() {
+ c.Putln("for _ = range list {")
+ } else {
+ c.Putln("for _, item := range list {")
+ }
c.Putln("size += %s", s.Size().Reduce("item."))
c.Putln("}")
c.Putln("return size")