summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-18 18:07:16 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-18 22:20:27 -0700
commit56e05985f999e9f3d8cda96026f5a2f68d28d016 (patch)
treeca629501f1944d7d4b0f67aeb717ef853e77bd52
parentc4c88aa65cfac511fcc830a7807da6ac9bde4d0a (diff)
decode_scan: s/initialized/rTypeOK/
-rw-r--r--decode_scan.go10
1 files 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
}
}