summaryrefslogtreecommitdiff
path: root/decode_scan.go
diff options
context:
space:
mode:
Diffstat (limited to 'decode_scan.go')
-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
}
}