MCPcopy Create free account
hub / github.com/brimdata/super / CopyFrom

Method CopyFrom

value.go:256–266  ·  view source on GitHub ↗

CopyFrom copies from into v, reusing v's storage if possible.

(from Value)

Source from the content-addressed store, hash-verified

254
255// CopyFrom copies from into v, reusing v's storage if possible.
256func (v *Value) CopyFrom(from Value) {
257 if from.IsNull() {
258 v.typ = from.typ
259 } else if _, ok := from.native(); ok {
260 *v = from
261 } else if _, ok := v.native(); ok {
262 *v = NewValue(from.Type(), bytes.Clone(from.bytes()))
263 } else {
264 *v = NewValue(from.Type(), append(v.bytes()[:0], from.bytes()...))
265 }
266}
267
268func (v Value) IsString() bool {
269 _, ok := TypeUnder(v.Type()).(*TypeOfString)

Callers 3

WriteMethod · 0.80
WriteWithKeyMethod · 0.80
writeIndexMethod · 0.80

Calls 6

nativeMethod · 0.95
bytesMethod · 0.95
NewValueFunction · 0.85
IsNullMethod · 0.80
TypeMethod · 0.65
CloneMethod · 0.65

Tested by

no test coverage detected