Commit 267bc2af authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Count O(1) not O(n)

parent b2fc9123
......@@ -454,10 +454,7 @@ extern "C" {
try {
jclass keyClass = env->FindClass( "Lorg/opengroup/openvds/MetadataKey;" );
MetadataKeyRange keys = GetAccess( handle )->GetMetadataKeys();
int nKeys = 0;
for( MetadataKey key : keys ) {
++nKeys;
}
int nKeys = keys.end() - keys.begin();
jmethodID initMethod = env->GetMethodID( keyClass, "<init>", "(ILjava/lang/String;Ljava/lang/String;)V" );
jobjectArray jKeysArray = env->NewObjectArray( nKeys, keyClass, (jobject)NULL );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment