MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / clone

Method clone

projects/JavaScript/proto/test.js:15374–15383  ·  view source on GitHub ↗

* Clone struct (deep clone) * @this {!StructVector} * @returns {!StructVector} Cloned struct

()

Source from the content-addressed store, hash-verified

15372 * @returns {!StructVector} Cloned struct
15373 */
15374 clone () {
15375 // Serialize the struct to the FBE stream
15376 let writer = new StructVectorModel(new fbe.WriteBuffer())
15377 writer.serialize(this)
15378
15379 // Deserialize the struct from the FBE stream
15380 let reader = new StructVectorModel(new fbe.ReadBuffer())
15381 reader.attachBuffer(writer.buffer)
15382 return reader.deserialize().value
15383 }
15384
15385 /**
15386 * Is this struct equal to other one?

Callers

nothing calls this directly

Calls 3

serializeMethod · 0.95
deserializeMethod · 0.95
attachBufferMethod · 0.45

Tested by

no test coverage detected