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

Method clone

projects/JavaScript/proto/proto.js:1908–1917  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1906 * @returns {!Balance} Cloned struct
1907 */
1908 clone () {
1909 // Serialize the struct to the FBE stream
1910 let writer = new BalanceModel(new fbe.WriteBuffer())
1911 writer.serialize(this)
1912
1913 // Deserialize the struct from the FBE stream
1914 let reader = new BalanceModel(new fbe.ReadBuffer())
1915 reader.attachBuffer(writer.buffer)
1916 return reader.deserialize().value
1917 }
1918
1919 /**
1920 * 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