Permalink
Browse files

cnt.lua: fix

  • Loading branch information...
1 parent b4eb095 commit faf30597a14bd77753d92bb26bdb267664498fb5 Dmitry Isaikin committed Jul 31, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 cnt.lua
View
@@ -23,7 +23,7 @@ function cnt_inc(space, ...)
if tuple ~= nil then break end
end
- return tuple[cnt_index]
+ return box.unpack('i', tuple[cnt_index])
end
--
@@ -37,11 +37,11 @@ function cnt_dec(space, ...)
local tuple = box.select(space, 0, ...)
if tuple == nil then return 0 end
- if tuple[cnt_index] == 1 then
+ if box.unpack('i', tuple[cnt_index]) == 1 then
box.delete(space, ...)
return 0
else
tuple = box.update(space, key, '-p', cnt_index, 1)
- return tuple[cnt_index]
+ return box.unpack('i', tuple[cnt_index])
end
end

0 comments on commit faf3059

Please sign in to comment.