Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def incrby(self, key, amount):
c = Int.decode(key.get(b'0')) + amount
key.update(Int.encode(c))
return c
def hincrby(self, key, field, amount):
c = Int.decode(key.value.get(field, b'0')) + amount
key.value[field] = Int.encode(c)
key.updated()
return c