LuaJIT compatibility.
This commit is contained in:
@@ -41,27 +41,6 @@ function utillib.clamp( val, min, max )
|
||||
return math.max( min, math.min( val, max ) )
|
||||
end
|
||||
|
||||
-- Returns changed value ( value to be changed, index, state( bool ) )
|
||||
function utillib.setBit( v, i, b )
|
||||
if b then
|
||||
return v | 1 << i
|
||||
else
|
||||
return v & ~( 1 << i )
|
||||
end
|
||||
end
|
||||
|
||||
function utillib.toggleBit( v, i )
|
||||
return v ~ ( 1 << i )
|
||||
end
|
||||
|
||||
function utillib.getBit( v, i )
|
||||
if v == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
return v & ( 1 << i ) > 0
|
||||
end
|
||||
|
||||
function utillib.utf8Sub( s, i, j )
|
||||
i = i or 1
|
||||
j = j or -1
|
||||
@@ -114,9 +93,6 @@ function utillib.split( str, sep )
|
||||
for str in string.gmatch( str, "([^"..sep.."]+)" ) do
|
||||
table.insert( t, str )
|
||||
end
|
||||
-- for s in string.gmatch( str, "([^"..sep.."]+)" ) do
|
||||
-- table.insert( t, s )
|
||||
-- end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user