From e5965749d17d5a70f92fdc981f863e85b7543838 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Wed, 26 Apr 2023 10:58:00 +0100 Subject: Slightly improve code quality of JSONIn.Read --- walk/read.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'walk') 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++ } } -- cgit v1.2.3