nimdbx icon indicating copy to clipboard operation
nimdbx copied to clipboard

'pastMinKey' can have side effects

Open aleclarson opened this issue 2 years ago • 1 comments

~/nimdbx/nimdbx/Cursor.nim(106, 6) Error: 'pastMinKey' can have side effects
> ~/nimdbx/nimdbx/Cursor.nim(106, 43) Hint: 'pastMinKey' calls `.sideEffect` 'compareKey'
>> ~/nimdbx/nimdbx/Cursor.nim(92, 6) Hint: 'compareKey' called by 'pastMinKey'

aleclarson avatar Sep 07 '21 15:09 aleclarson

Indeed.

theAkito avatar Feb 18 '22 23:02 theAkito

Hi, new compiler versions are more strict with func functions. This is probably the reason why this project doesn't compile and emits the error above. You may just change: func -> proc for the two funcs: pastMinKey and pastMaxKey I also added a pull request that fixes the issue.

Luteva-ssh avatar Dec 30 '22 08:12 Luteva-ssh

Fixed as part of #21.

(I’d prefer to leave these as func and fix the bug by making compareKey and mdbx_compare_key (sp?) funcs too, but it’s not a big deal.)

snej avatar Apr 08 '23 19:04 snej