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

Method clone

projects/JavaScript/proto/test.js:13733–13742  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

13731 * @returns {!StructArray} Cloned struct
13732 */
13733 clone () {
13734 // Serialize the struct to the FBE stream
13735 let writer = new StructArrayModel(new fbe.WriteBuffer())
13736 writer.serialize(this)
13737
13738 // Deserialize the struct from the FBE stream
13739 let reader = new StructArrayModel(new fbe.ReadBuffer())
13740 reader.attachBuffer(writer.buffer)
13741 return reader.deserialize().value
13742 }
13743
13744 /**
13745 * 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