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

Method clone

projects/JavaScript/proto/proto.js:2820–2829  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2818 * @returns {!Account} Cloned struct
2819 */
2820 clone () {
2821 // Serialize the struct to the FBE stream
2822 let writer = new AccountModel(new fbe.WriteBuffer())
2823 writer.serialize(this)
2824
2825 // Deserialize the struct from the FBE stream
2826 let reader = new AccountModel(new fbe.ReadBuffer())
2827 reader.attachBuffer(writer.buffer)
2828 return reader.deserialize().value
2829 }
2830
2831 /**
2832 * 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