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

Method clone

projects/JavaScript/proto/test.js:18550–18559  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

18548 * @returns {!StructSet} Cloned struct
18549 */
18550 clone () {
18551 // Serialize the struct to the FBE stream
18552 let writer = new StructSetModel(new fbe.WriteBuffer())
18553 writer.serialize(this)
18554
18555 // Deserialize the struct from the FBE stream
18556 let reader = new StructSetModel(new fbe.ReadBuffer())
18557 reader.attachBuffer(writer.buffer)
18558 return reader.deserialize().value
18559 }
18560
18561 /**
18562 * 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