Skip to content

Commit 2a6b79f

Browse files
author
OpenClaw
committed
fix: StyLua formatting for polyfills and ^ operator
1 parent 509f0f5 commit 2a6b79f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/protobuf/init.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ local bit64_to_hex = bit64.to_hex
3030
local bit64_to_number = bit64.to_number
3131

3232
-- Lua 5.3+ removed math.frexp and math.ldexp; provide polyfills
33-
local math_frexp = math.frexp or function(x)
34-
if x == 0 then return 0, 0 end
35-
local e = math.floor(math.log(math.abs(x)) / math.log(2)) + 1
36-
return x / 2^e, e
37-
end
33+
local math_frexp = math.frexp
34+
or function(x)
35+
if x == 0 then
36+
return 0, 0
37+
end
38+
local e = math.floor(math.log(math.abs(x)) / math.log(2)) + 1
39+
return x / 2 ^ e, e
40+
end
3841
local math_ldexp = math.ldexp or function(m, e)
39-
return m * 2^e
42+
return m * 2 ^ e
4043
end
4144

42-
4345
--- Check if a value is a list (sequential table).
4446
--- @param t any The value to check.
4547
--- @return boolean is_list True if the value is a list.

0 commit comments

Comments
 (0)