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

Method clone

projects/JavaScript/proto/test.js:5881–5890  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

5879 * @returns {!StructOptional} Cloned struct
5880 */
5881 clone () {
5882 // Serialize the struct to the FBE stream
5883 let writer = new StructOptionalModel(new fbe.WriteBuffer())
5884 writer.serialize(this)
5885
5886 // Deserialize the struct from the FBE stream
5887 let reader = new StructOptionalModel(new fbe.ReadBuffer())
5888 reader.attachBuffer(writer.buffer)
5889 return reader.deserialize().value
5890 }
5891
5892 /**
5893 * 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