Fix iterator next.

`next` must return the "next" value.
But here, the next value is the value of the current iterator.
This commit is contained in:
Matthieu Gautier 2023-06-21 11:38:47 +02:00
parent 7315228b06
commit 1806febcf4
2 changed files with 2 additions and 2 deletions

View File

@ -64,8 +64,8 @@ METHOD0(jboolean, hasNext) {
} }
METHOD0(jobject, next) { METHOD0(jobject, next) {
(*THIS)++;
zim::Entry entry = **THIS; zim::Entry entry = **THIS;
(*THIS)++;
return BUILD_WRAPPER("org/kiwix/libzim/Entry", entry); return BUILD_WRAPPER("org/kiwix/libzim/Entry", entry);
} }

View File

@ -49,8 +49,8 @@ METHOD0(jboolean, hasNext) {
} }
METHOD0(jobject, next) { METHOD0(jobject, next) {
(*THIS)++;
zim::SuggestionItem item = **THIS; zim::SuggestionItem item = **THIS;
(*THIS)++;
return BUILD_WRAPPER("org/kiwix/libzim/SuggestionItem", item); return BUILD_WRAPPER("org/kiwix/libzim/SuggestionItem", item);
} }