Skip to content

Commit

Permalink
Fix SuggestionIterator hasNext.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgautierfr committed Aug 7, 2023
1 parent f561034 commit 8323333
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/main/cpp/libzim/suggestion_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ METHOD0(void, dispose)
} CATCH_EXCEPTION()

METHOD0(jboolean, hasNext) {
NATIVE_TYPE next(*THIS);
next++;
// THIS is the next item to return. So we have to check it with end
auto end = getPtr<NATIVE_TYPE>(env, thisObj, "nativeHandleEnd");
return next == *end;
return *THIS != *end;
} CATCH_EXCEPTION(false)

METHOD0(jobject, next) {

zim::SuggestionItem item = **THIS;
(*THIS)++;
return BUILD_WRAPPER("org/kiwix/libzim/SuggestionItem", item);
Expand Down

0 comments on commit 8323333

Please sign in to comment.