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

Method clone

projects/JavaScript/proto/test.js:17015–17024  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

17013 * @returns {!StructList} Cloned struct
17014 */
17015 clone () {
17016 // Serialize the struct to the FBE stream
17017 let writer = new StructListModel(new fbe.WriteBuffer())
17018 writer.serialize(this)
17019
17020 // Deserialize the struct from the FBE stream
17021 let reader = new StructListModel(new fbe.ReadBuffer())
17022 reader.attachBuffer(writer.buffer)
17023 return reader.deserialize().value
17024 }
17025
17026 /**
17027 * 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