Sha256: c97e5829ec79b84ed2bad24bf10c45f68c7b04c025a1f313cc4ca8bfaeeb9c1b

Contents?: true

Size: 320 Bytes

Versions: 4

Compression:

Stored size: 320 Bytes

Contents

--
-- Taken from http://tokyocabinet.sourceforge.net/tyrantdoc/#luaext
--

function incr (key, value)
  value = tonumber(value)
  if not value then
    return nil
  end
  local old = tonumber(_get(key))
  if old then
    value = value + old
  end
  if not _put(key, value) then
    return nil
  end
  return value
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metry-1.0.0 vendor/rufus-tokyo/spec/incr.lua
metry-1.0.1 vendor/rufus-tokyo/spec/incr.lua
metry-1.1.0 vendor/rufus-tokyo/spec/incr.lua
metry-1.2.0 vendor/rufus-tokyo/spec/incr.lua