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

Method clone

projects/JavaScript/proto/protoex.js:2066–2075  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2064 * @returns {!Balance} Cloned struct
2065 */
2066 clone () {
2067 // Serialize the struct to the FBE stream
2068 let writer = new BalanceModel(new fbe.WriteBuffer())
2069 writer.serialize(this)
2070
2071 // Deserialize the struct from the FBE stream
2072 let reader = new BalanceModel(new fbe.ReadBuffer())
2073 reader.attachBuffer(writer.buffer)
2074 return reader.deserialize().value
2075 }
2076
2077 /**
2078 * 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