-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
For various access methods to DynamicAssetArrays, a loop is beneficial (or required); either implementing IEnumerable or a Length (or Count, or whatever) property would improve the ability to do this. As the elems array is internal, this is not cleanly doable with an extension method. For now, I'm using:
public static int Count( this DynamicAssetArray array ) {
int length = 0;
dynamic foo = null;
try {
while ( true ) {
foo = array[length];
length++;
}
} catch ( IndexOutOfRangeException ) {
return length;
}
}However, this is quite a performance hit for the many DynamicAssetArrays present in the assets I'm examining. Would you be willing to consider this? I'm more than happy to submit a PR if it's something you'd consider.
Metadata
Metadata
Assignees
Labels
No labels