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

Method clone

projects/JavaScript/proto/protoex.js:2971–2980  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

2969 * @returns {!Account} Cloned struct
2970 */
2971 clone () {
2972 // Serialize the struct to the FBE stream
2973 let writer = new AccountModel(new fbe.WriteBuffer())
2974 writer.serialize(this)
2975
2976 // Deserialize the struct from the FBE stream
2977 let reader = new AccountModel(new fbe.ReadBuffer())
2978 reader.attachBuffer(writer.buffer)
2979 return reader.deserialize().value
2980 }
2981
2982 /**
2983 * 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