This commit is contained in:
guangwu 2024-05-09 20:37:28 +03:00 committed by GitHub
commit 6b1bacc345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 10 deletions

View File

@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
code = code.End.Next code = code.End.Next
} }
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:]
if idx < mapCtx.Len { if idx < mapCtx.Len {
mapCtx.Idx = int(idx) mapCtx.Idx = int(idx)
mapCtx.Start = len(b) mapCtx.Start = len(b)
@ -453,7 +453,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 {
b = appendColon(ctx, b) b = appendColon(ctx, b)
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:]
mapCtx.Start = len(b) mapCtx.Start = len(b)
} }
value := mapitervalue(&mapCtx.Iter) value := mapitervalue(&mapCtx.Iter)

View File

@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
code = code.End.Next code = code.End.Next
} }
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:]
if idx < mapCtx.Len { if idx < mapCtx.Len {
mapCtx.Idx = int(idx) mapCtx.Idx = int(idx)
mapCtx.Start = len(b) mapCtx.Start = len(b)
@ -453,7 +453,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 {
b = appendColon(ctx, b) b = appendColon(ctx, b)
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:]
mapCtx.Start = len(b) mapCtx.Start = len(b)
} }
value := mapitervalue(&mapCtx.Iter) value := mapitervalue(&mapCtx.Iter)

View File

@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
code = code.End.Next code = code.End.Next
} }
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:]
if idx < mapCtx.Len { if idx < mapCtx.Len {
mapCtx.Idx = int(idx) mapCtx.Idx = int(idx)
mapCtx.Start = len(b) mapCtx.Start = len(b)
@ -453,7 +453,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 {
b = appendColon(ctx, b) b = appendColon(ctx, b)
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:]
mapCtx.Start = len(b) mapCtx.Start = len(b)
} }
value := mapitervalue(&mapCtx.Iter) value := mapitervalue(&mapCtx.Iter)

View File

@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
code = code.End.Next code = code.End.Next
} }
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:]
if idx < mapCtx.Len { if idx < mapCtx.Len {
mapCtx.Idx = int(idx) mapCtx.Idx = int(idx)
mapCtx.Start = len(b) mapCtx.Start = len(b)
@ -453,7 +453,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 {
b = appendColon(ctx, b) b = appendColon(ctx, b)
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:]
mapCtx.Start = len(b) mapCtx.Start = len(b)
} }
value := mapitervalue(&mapCtx.Iter) value := mapitervalue(&mapCtx.Iter)

View File

@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
code = code.End.Next code = code.End.Next
} }
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:]
if idx < mapCtx.Len { if idx < mapCtx.Len {
mapCtx.Idx = int(idx) mapCtx.Idx = int(idx)
mapCtx.Start = len(b) mapCtx.Start = len(b)
@ -453,7 +453,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b
if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 {
b = appendColon(ctx, b) b = appendColon(ctx, b)
} else { } else {
mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:]
mapCtx.Start = len(b) mapCtx.Start = len(b)
} }
value := mapitervalue(&mapCtx.Iter) value := mapitervalue(&mapCtx.Iter)