From 56e05985f999e9f3d8cda96026f5a2f68d28d016 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 18 Feb 2023 18:07:16 -0700 Subject: decode_scan: s/initialized/rTypeOK/ --- decode_scan.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/decode_scan.go b/decode_scan.go index 85f3190..1f29a95 100644 --- a/decode_scan.go +++ b/decode_scan.go @@ -19,8 +19,8 @@ type runeTypeScanner struct { parser jsonparse.Parser // initialized by constructor offset int64 - initialized bool - repeat bool + rTypeOK bool + repeat bool rRune rune rSize int @@ -37,13 +37,13 @@ type runeTypeScanner struct { // end of file at start of value: (_, 0, RuneTypeError, &DecodeSyntaxError{Offset: offset: Err: io.EOF}) func (sc *runeTypeScanner) ReadRuneType() (rune, int, jsonparse.RuneType, error) { switch { - case sc.initialized && (sc.rType == jsonparse.RuneTypeError || sc.rType == jsonparse.RuneTypeEOF): + case sc.rTypeOK && (sc.rType == jsonparse.RuneTypeError || sc.rType == jsonparse.RuneTypeEOF): // do nothing case sc.repeat: sc.offset += int64(sc.rSize) _, _, _ = sc.inner.ReadRune() default: - sc.initialized = true + sc.rTypeOK = true again: var err error sc.rRune, sc.rSize, err = sc.inner.ReadRune() @@ -181,6 +181,6 @@ func (sc *runeTypeScanner) Reset() { // tell it to use that rType and rErr _ = sc.UnreadRune() // we set it up to always succeed default: - sc.initialized = false + sc.rTypeOK = false } } -- cgit v1.2.3