Software /
code /
prosody
Diff
util/serialization.lua @ 12781:22066b02887f
util.startup: Provide a common Lua 5.3+ math.type() for Lua 5.2
Code deduplication
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 19 Oct 2022 16:25:05 +0200 (2022-10-19) |
parent | 11093:ec14d4fce855 |
child | 12782:8815d3090928 |
line wrap: on
line diff
--- a/util/serialization.lua Thu Oct 20 16:56:45 2022 +0200 +++ b/util/serialization.lua Wed Oct 19 16:25:05 2022 +0200 @@ -22,9 +22,7 @@ local envload = require"util.envload".envload; local pos_inf, neg_inf = math.huge, -math.huge; -local m_type = math.type or function (n) - return n % 1 == 0 and n <= 9007199254740992 and n >= -9007199254740992 and "integer" or "float"; -end; +local m_type = math.type; local function rawpairs(t) return next, t, nil;