claunia / plist-cil

C#/.NET parser for Apple and GnuStep Property List (aka plist), based on Java's dd-plist
Other
54 stars 17 forks source link

Add UID.ToUInt64() method #58

Closed qmfrederik closed 5 years ago

qmfrederik commented 5 years ago

Currenly to only way to get the value of a UID is to call .Bytes, but this allocates a new byte[] very time. That's a bit silly, as we store the value of this UID in the value field as a ulong.

This PR adds a ToUInt64 method, which gives direct access to the value of the UID. It gives a performance improvement in some scenarios in my application (because we avoid creating a byte[] which needs to be garbage collected).