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

Method clone

projects/JavaScript/proto/test.js:23045–23054  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

23043 * @returns {!StructHashEx} Cloned struct
23044 */
23045 clone () {
23046 // Serialize the struct to the FBE stream
23047 let writer = new StructHashExModel(new fbe.WriteBuffer())
23048 writer.serialize(this)
23049
23050 // Deserialize the struct from the FBE stream
23051 let reader = new StructHashExModel(new fbe.ReadBuffer())
23052 reader.attachBuffer(writer.buffer)
23053 return reader.deserialize().value
23054 }
23055
23056 /**
23057 * 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