You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, subclasses of SerializedType do not have access to the private final SerializedType#bytes field. Thus, in order to access those bytes (e.g., see AmountType#isNative) the byte array is copied in order to provide immutable access to sub-classes.
From a performance perspective, this is mostly just fine because we don't expect xrpl4j to be processing such heavy transaction load that this byte-array copy will matter. However, this might matter.
Thus, because the bytes array is meant to be immutable (and the current pattern we see here exists because Java has not immutable/final array primitive), we can copy the bytes array once from SerializedType and then access values from there in a non-copy fashion.