• Daniel Martí's avatar
    encoding/json: simplify some pieces of the encoder · 9d1540b7
    Daniel Martí authored
    Some WriteByte('\\') calls can be deduplicated.
    
    fillField is used in two occasions, but it is unnecessary when adding
    fields to the "next" stack, as those aren't used for the final encoding.
    Inline the func with its only remaining call.
    
    Finally, unindent a default-if block.
    
    The performance of the encoder is unaffected:
    
    name           old time/op    new time/op    delta
    CodeEncoder-4    6.65ms ± 1%    6.65ms ± 0%   ~     (p=0.662 n=6+5)
    
    Change-Id: Ie55baeab89abad9b9f13e9f6ca886a670c30dba9
    Reviewed-on: https://go-review.googlesource.com/122461
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    9d1540b7
Name
Last commit
Last update
..
ascii85 Loading commit data...
asn1 Loading commit data...
base32 Loading commit data...
base64 Loading commit data...
binary Loading commit data...
csv Loading commit data...
gob Loading commit data...
hex Loading commit data...
json Loading commit data...
pem Loading commit data...
xml Loading commit data...
encoding.go Loading commit data...