Remove unnecessary object creation.
FossilOrigin-Name: f032c8fbe514fb9007a4ce788ee7c4308dfa2522a36117151ae565d577b404ea
This commit is contained in:
parent
65287b16e3
commit
321fd32885
1 changed files with 1 additions and 2 deletions
|
|
@ -50,7 +50,7 @@
|
||||||
## # tnetobj is now equivalent to the structure:
|
## # tnetobj is now equivalent to the structure:
|
||||||
## # @[(key: test, val: 1.3), (key: key2, val: true), (key: things, val: @[1, 2, 3])]
|
## # @[(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[ "test" ]
|
||||||
## echo tnetobj[ "key2" ]
|
## echo tnetobj[ "key2" ]
|
||||||
## for item in tnetobj[ "things" ]:
|
## for item in tnetobj[ "things" ]:
|
||||||
|
|
@ -248,7 +248,6 @@ proc parse_tnetstring*( data: string ): TNetstringNode =
|
||||||
if ( key.kind != TNetstringString ): raiseParseErr( result, "Invalid data: Object keys must be strings." )
|
if ( key.kind != TNetstringString ): raiseParseErr( result, "Invalid data: Object keys must be strings." )
|
||||||
|
|
||||||
var value = parse_tnetstring( key.extra )
|
var value = parse_tnetstring( key.extra )
|
||||||
result.fields = @[]
|
|
||||||
result.fields.add( (key: key.str, val: value) )
|
result.fields.add( (key: key.str, val: value) )
|
||||||
|
|
||||||
while value.extra != "":
|
while value.extra != "":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue