diff --git a/internal/cmd/generator/vm.go.tmpl b/internal/cmd/generator/vm.go.tmpl index 645d20f..afe9334 100644 --- a/internal/cmd/generator/vm.go.tmpl +++ b/internal/cmd/generator/vm.go.tmpl @@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.End.Next } } 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 { mapCtx.Idx = int(idx) 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 { b = appendColon(ctx, b) } 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) } value := mapitervalue(&mapCtx.Iter) diff --git a/internal/encoder/vm/vm.go b/internal/encoder/vm/vm.go index 645d20f..afe9334 100644 --- a/internal/encoder/vm/vm.go +++ b/internal/encoder/vm/vm.go @@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.End.Next } } 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 { mapCtx.Idx = int(idx) 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 { b = appendColon(ctx, b) } 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) } value := mapitervalue(&mapCtx.Iter) diff --git a/internal/encoder/vm_color/vm.go b/internal/encoder/vm_color/vm.go index a63e83e..ce2a008 100644 --- a/internal/encoder/vm_color/vm.go +++ b/internal/encoder/vm_color/vm.go @@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.End.Next } } 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 { mapCtx.Idx = int(idx) 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 { b = appendColon(ctx, b) } 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) } value := mapitervalue(&mapCtx.Iter) diff --git a/internal/encoder/vm_color_indent/vm.go b/internal/encoder/vm_color_indent/vm.go index 3b4e22e..5959209 100644 --- a/internal/encoder/vm_color_indent/vm.go +++ b/internal/encoder/vm_color_indent/vm.go @@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.End.Next } } 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 { mapCtx.Idx = int(idx) 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 { b = appendColon(ctx, b) } 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) } value := mapitervalue(&mapCtx.Iter) diff --git a/internal/encoder/vm_indent/vm.go b/internal/encoder/vm_indent/vm.go index 836c5c8..c15d807 100644 --- a/internal/encoder/vm_indent/vm.go +++ b/internal/encoder/vm_indent/vm.go @@ -437,7 +437,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.End.Next } } 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 { mapCtx.Idx = int(idx) 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 { b = appendColon(ctx, b) } 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) } value := mapitervalue(&mapCtx.Iter)