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

Method clone

projects/JavaScript/proto/test.js:11052–11061  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

11050 * @returns {!StructNested} Cloned struct
11051 */
11052 clone () {
11053 // Serialize the struct to the FBE stream
11054 let writer = new StructNestedModel(new fbe.WriteBuffer())
11055 writer.serialize(this)
11056
11057 // Deserialize the struct from the FBE stream
11058 let reader = new StructNestedModel(new fbe.ReadBuffer())
11059 reader.attachBuffer(writer.buffer)
11060 return reader.deserialize().value
11061 }
11062
11063 /**
11064 * 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