Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_key(self, lkey):
if not self.curs.set_key(lkey):
return False
# set_key for a scan is only logical if it's a dup scan
if self.dupsort:
self.iterfunc = functools.partial(lmdb.Cursor.iternext_dup, keys=True)
else:
self.iterfunc = lmdb.Cursor.iternext
self.genr = self.iterfunc(self.curs)
self.atitem = next(self.genr)
return True