Remove unnecessary object creation.
authorMahlon E. Smith <mahlon@martini.nu>
Tue, 19 May 2015 12:55:18 -0700
changeset 1 87a0365b799b
parent 0 755c3645e3dc
child 2 05f836c02154
Remove unnecessary object creation.
tnetstring.nim
--- a/tnetstring.nim	Tue May 19 12:46:52 2015 -0700
+++ b/tnetstring.nim	Tue May 19 12:55:18 2015 -0700
@@ -50,7 +50,7 @@
 ##   # tnetobj is now equivalent to the structure:
 ##   # @[(key: test, val: 1.3), (key: key2, val: true), (key: things, val: @[1, 2, 3])]
 ##
-##   assert ( tnetobj.kind == TNetstringObject )
+##   assert( tnetobj.kind == TNetstringObject )
 ##   echo tnetobj[ "test" ]
 ##   echo tnetobj[ "key2" ]
 ##   for item in tnetobj[ "things" ]:
@@ -248,7 +248,6 @@
             if ( key.kind != TNetstringString ): raiseParseErr( result, "Invalid data: Object keys must be strings." )
 
             var value = parse_tnetstring( key.extra )
-            result.fields = @[]
             result.fields.add( (key: key.str, val: value) )
 
             while value.extra != "":