From 59425418c51ba6584c944b7659b1ab5c59c1f856 Mon Sep 17 00:00:00 2001 From: marselester Date: Wed, 8 Feb 2023 13:13:43 -0500 Subject: [PATCH] Use pointer semantics in depthCounter --- sig.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sig.go b/sig.go index a168c9cd..5bd797b6 100644 --- a/sig.go +++ b/sig.go @@ -183,19 +183,19 @@ func (cnt *depthCounter) Valid() bool { return cnt.arrayDepth <= 32 && cnt.structDepth <= 32 && cnt.dictEntryDepth <= 32 } -func (cnt depthCounter) EnterArray() *depthCounter { +func (cnt *depthCounter) EnterArray() *depthCounter { cnt.arrayDepth++ - return &cnt + return cnt } -func (cnt depthCounter) EnterStruct() *depthCounter { +func (cnt *depthCounter) EnterStruct() *depthCounter { cnt.structDepth++ - return &cnt + return cnt } -func (cnt depthCounter) EnterDictEntry() *depthCounter { +func (cnt *depthCounter) EnterDictEntry() *depthCounter { cnt.dictEntryDepth++ - return &cnt + return cnt } // Try to read a single type from this string. If it was successful, err is nil