Skip to content

Commit

Permalink
Simplify zed.Value.Copy for native Values (#5331)
Browse files Browse the repository at this point in the history
There's no need to call newNativeValue since it'll just return a Value
that's identical to v byte-wise.
  • Loading branch information
nwt authored Oct 9, 2024
1 parent 7201a36 commit c0775aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions value.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ func (v Value) IsNull() bool {

// Copy returns a copy of v that shares no storage.
func (v Value) Copy() Value {
if x, ok := v.native(); ok {
return newNativeValue(v.Type(), x)
if _, ok := v.native(); ok {
return v
}
return NewValue(v.Type(), bytes.Clone(v.bytes()))
}
Expand Down

0 comments on commit c0775aa

Please sign in to comment.