Skip to content

Commit

Permalink
Update com_spotify_voyager_jni_Index.cpp (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
psobot authored Oct 17, 2023
1 parent 22c46d1 commit 63b3c81
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion java/com_spotify_voyager_jni_Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,12 @@ void Java_com_spotify_voyager_jni_Index_nativeLoadFromFileWithParameters(
") does not match the number of dimensions used in this file (" +
std::to_string(metadata->getNumDimensions()) + ").");
}

setHandle<Index>(
env, self,
loadTypedIndexFromMetadata(std::move(metadata), inputStream)
.release());
return;
}

switch (toStorageDataType(env, storageDataType)) {
Expand Down Expand Up @@ -786,6 +792,12 @@ void Java_com_spotify_voyager_jni_Index_nativeLoadFromInputStreamWithParameters(
") does not match the number of dimensions used in this file (" +
std::to_string(metadata->getNumDimensions()) + ").");
}

setHandle<Index>(
env, self,
loadTypedIndexFromMetadata(std::move(metadata), inputStream)
.release());
return;
}

switch (toStorageDataType(env, storageDataType)) {
Expand Down Expand Up @@ -827,4 +839,4 @@ void Java_com_spotify_voyager_jni_Index_nativeDestructor(JNIEnv *env,
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
}
}

0 comments on commit 63b3c81

Please sign in to comment.