diff options
| author | Mel <einebeere@gmail.com> | 2022-05-20 00:01:11 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-05-20 00:01:11 +0200 |
| commit | fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5 (patch) | |
| tree | 2d153d41fb5799828c8e8ebd8dc1158ddac9e9ac /pkg/lang/vm/value/value.go | |
| parent | bfa32b8b880b42eda6007ba81f8fbbd340009322 (diff) | |
| download | jinx-fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5.tar.zst jinx-fe93d5c015e8e2c883d2c1e74f2e5ce071256cb5.zip | |
Access methods for VM data and stop Array copying
Diffstat (limited to 'pkg/lang/vm/value/value.go')
| -rw-r--r-- | pkg/lang/vm/value/value.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go index e932ed3..daa17dd 100644 --- a/pkg/lang/vm/value/value.go +++ b/pkg/lang/vm/value/value.go @@ -2,7 +2,7 @@ package value type Value struct { t Type - d any + d Data } func NewInt(x int64) Value { @@ -27,7 +27,7 @@ func NewBool(b bool) Value { func NewArray(arr []Value) Value { t := Type{Kind: ArrayType} - return Value{t: t, d: ArrayData(arr)} + return Value{t: t, d: ArrayData{arr: &arr}} } func NewNull() Value { @@ -47,6 +47,6 @@ func (v Value) Type() Type { return v.t } -func (v Value) Data() any { +func (v Value) Data() Data { return v.d } |
