Upstream itchyny/gojq state of the touched files before c32933425c
This commit is contained in:
1 parent
36684e920c
commit
d3960aff31
3 files changed
+48
-202
No files matched your search
@@ -1488,17 +1488,6 @@ func (a allocator) allocated(v any) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// release forgets every allocated address when the value is one of them, so
|
||||
// that a value handed to a query is copied on update again.
|
||||
func (a allocator) release(v any) {
|
||||
switch v.(type) {
|
||||
case map[string]any, []any:
|
||||
if a.allocated(v) {
|
||||
clear(a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (a allocator) makeObject(l int) map[string]any {
|
||||
v := make(map[string]any, l)
|
||||
if a != nil {
|
||||
@@ -1525,15 +1514,6 @@ func funcSetpathWithAllocator(v any, args []any) any {
|
||||
return setpath(v, args[0], args[1], args[2].(allocator))
|
||||
}
|
||||
|
||||
// Used in compiler#compileModify: the update function may store the value
|
||||
// anywhere, so it must not be modified in place afterwards. Registered as
|
||||
// getpath to keep tracking paths through the call.
|
||||
func funcGetpathWithAllocator(v any, args []any) any {
|
||||
w := funcGetpath(v, args[0])
|
||||
args[1].(allocator).release(w)
|
||||
return w
|
||||
}
|
||||
|
||||
func setpath(v, p, n any, a allocator) any {
|
||||
path, ok := p.([]any)
|
||||
if !ok {
|
||||
|
||||
Reference in new issue
Block a user