go/src/encoding
Daniel Martí 49662bc6b0 all: simplify multiple for loops
If a for loop has a simple condition and begins with a simple
"if x { break; }"; we can simply add "!x" to the loop's condition.

While at it, simplify a few assignments to use the common pattern
"x := staticDefault; if cond { x = otherValue(); }".

Finally, simplify a couple of var declarations.

Change-Id: I413982c6abd32905adc85a9a666cb3819139c19f
Reviewed-on: https://go-review.googlesource.com/c/go/+/165342
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-08 14:29:19 +00:00
..
ascii85 encoding/ascii85: make bigtest big again 2017-06-23 14:28:30 +00:00
asn1 all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
base32 encoding/base32: remove ineffectual assignment in test 2019-03-02 02:14:45 +00:00
base64 encoding/base64: do not slice past output unnecessarily 2019-03-05 18:37:55 +00:00
binary encoding/binary: simplify Read and Write 2018-09-04 14:52:30 +00:00
csv encoding/csv: document that Writer is buffered 2019-03-04 05:47:35 +00:00
gob encoding/gob: update documentation in doc.go for wireType 2019-03-08 03:57:49 +00:00
hex encoding/hex: simplify encoder arithmetic 2019-03-05 17:40:09 +00:00
json all: simplify multiple for loops 2019-03-08 14:29:19 +00:00
pem encoding/pem: skip whitespace work on most inputs 2019-03-02 20:43:08 +00:00
xml encoding/xml, encoding/json: docs and examples using custom marshalers 2018-12-12 14:18:06 +00:00
encoding.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00