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

Method clone

projects/JavaScript/proto/test.js:19775–19784  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

19773 * @returns {!StructMap} Cloned struct
19774 */
19775 clone () {
19776 // Serialize the struct to the FBE stream
19777 let writer = new StructMapModel(new fbe.WriteBuffer())
19778 writer.serialize(this)
19779
19780 // Deserialize the struct from the FBE stream
19781 let reader = new StructMapModel(new fbe.ReadBuffer())
19782 reader.attachBuffer(writer.buffer)
19783 return reader.deserialize().value
19784 }
19785
19786 /**
19787 * 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