keyvalues: adjust KvSavePosition return value to implementation (#757)

The current ``KvSavePosition`` definition does not reflect the behaviour seen in [core/smn_keyvalues.cpp#L973-L981](404e96ad45/core/smn_keyvalues.cpp (L973-L981)). This can cause problems if some procedure on sp expects ``KvSavePosition`` to always add one node to the stack, no matter if there is no higher node.

Co-authored-by: peace-maker <peace-maker@wcfan.de>
This commit is contained in:
fakuivan 2023-03-30 01:06:36 -03:00 committed by GitHub
parent 8826663186
commit 6670b93cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,7 +241,8 @@ methodmap KeyValues < Handle
// have the previous key saved for backwards traversal.
//
// @param kv KeyValues Handle.
public native void SavePosition();
// @return True on success, false if there is no higher node.
public native bool SavePosition();
// Jumps back to the previous position. Returns false if there are no
// previous positions (i.e., at the root node). This should be called
@ -523,9 +524,10 @@ native bool KvGotoNextKey(Handle kv, bool keyOnly=true);
* have the previous key saved for backwards traversal.
*
* @param kv KeyValues Handle.
* @return True on success, false if there is no higher node.
* @error Invalid Handle.
*/
native void KvSavePosition(Handle kv);
native bool KvSavePosition(Handle kv);
/**
* Removes the given key from the current position.