<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/walk/read.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-26 10:58:00 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-26 10:58:00 +0100
commite5965749d17d5a70f92fdc981f863e85b7543838 (patch)
tree9756104001cdf337be9562f87eb6fabc8ad7ceee /walk/read.go
parent43aeb71f2d89ef74227de99a065c4af3a38fc755 (diff)
downloadstred-go-e5965749d17d5a70f92fdc981f863e85b7543838.tar
Slightly improve code quality of JSONIn.Read
Diffstat (limited to 'walk/read.go')
-rw-r--r--walk/read.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/walk/read.go b/walk/read.go
index e1b33a4..bedb856 100644
--- a/walk/read.go
+++ b/walk/read.go
@@ -179,10 +179,10 @@ func (in *JSONIn) Read() (WalkItem, error) {
}
}
action := in.actionBuffer[in.actionIndex]
+ in.actionIndex++
switch action {
case ActionReadValue:
value := in.readValue()
- in.actionIndex++
return WalkItem {
Value: value,
Path: in.path,
@@ -208,7 +208,6 @@ func (in *JSONIn) Read() (WalkItem, error) {
default:
panic("Invalid ReadAction")
}
- in.actionIndex++
}
}