Skip to content

Commit 683e7a6

Browse files
Make Object.Reset method public (#4)
1 parent efa4c64 commit 683e7a6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

arena.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (a *Arena) Reset() {
3737
func (a *Arena) NewObject() *Value {
3838
v := a.c.getValue()
3939
v.t = TypeObject
40-
v.o.reset()
40+
v.o.Reset()
4141
return v
4242
}
4343

parser.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ func parseObject(s string, c *cache, depth int) (*Value, string, error) {
280280
if s[0] == '}' {
281281
v := c.getValue()
282282
v.t = TypeObject
283-
v.o.reset()
283+
v.o.Reset()
284284
return v, s[1:], nil
285285
}
286286

287287
o := c.getValue()
288288
o.t = TypeObject
289-
o.o.reset()
289+
o.o.Reset()
290290
for {
291291
var err error
292292
kv := o.o.getKV()
@@ -528,7 +528,8 @@ type Object struct {
528528
keysUnescaped bool
529529
}
530530

531-
func (o *Object) reset() {
531+
// Removes all values from this object
532+
func (o *Object) Reset() {
532533
o.kvs = o.kvs[:0]
533534
o.keysUnescaped = false
534535
}

0 commit comments

Comments
 (0)