Skip to content

Commit

Permalink
Fix bit32.bor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekdohibs committed Jan 3, 2015
1 parent af47d73 commit 3bd07ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bit32.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ end

bit32.bor = function(x, y)
-- Common usecases, they deserve to be optimized
if y == 0xff then return x%0x100 end
if y == 0xffff then return x%0x10000 end
if y == 0xff then return x - (x%0x100) + 0xff end
if y == 0xffff then return x - (x%0x10000) + 0xffff end
if y == 0xffffffff then return 0xffffffff end

x, y = x%P, y%P
local r = 0
Expand Down

0 comments on commit 3bd07ca

Please sign in to comment.