From 44795076f783e76f8e40bb20fef756767223b88f Mon Sep 17 00:00:00 2001 From: Pinya <800pin.ru@gmail.com> Date: Sun, 22 Jul 2018 16:45:24 +0300 Subject: [PATCH] remove math.module because it's do same as math.fmod --- !Compatibility/api/luaAPI.lua | 13 ------------- !DebugTools/Blizzard_DebugTools.lua | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/!Compatibility/api/luaAPI.lua b/!Compatibility/api/luaAPI.lua index a1b926f..9468b4b 100644 --- a/!Compatibility/api/luaAPI.lua +++ b/!Compatibility/api/luaAPI.lua @@ -58,19 +58,6 @@ function math.modf(i) return int, i - int end -function math.modulo(x, y) - x = type(x) ~= "number" and tonumber(i) or x - y = type(y) ~= "number" and tonumber(i) or y - - if type(x) ~= "number" then - error(format("bad argument #1 to 'modulo' (number expected, got %s)", x and type(x) or "no value"), 2) - elseif type(y) ~= "number" then - error(format("bad argument #2 to 'modulo' (number expected, got %s)", y and type(y) or "no value"), 2) - end - - return x - floor(x / y) * y -end - function math.cosh(i) i = type(i) ~= "number" and tonumber(i) or i diff --git a/!DebugTools/Blizzard_DebugTools.lua b/!DebugTools/Blizzard_DebugTools.lua index 80bb25a..89b5e91 100644 --- a/!DebugTools/Blizzard_DebugTools.lua +++ b/!DebugTools/Blizzard_DebugTools.lua @@ -1,4 +1,4 @@ -local modulo = math.modulo +local fmod = math.fmod local getn = table.getn local LUA_ERROR = "Lua Error" @@ -102,7 +102,7 @@ function EventTraceFrame_OnEvent (self, event, ...) local hours = math.floor(minutes / 60); seconds = seconds - 60 * minutes; minutes = minutes - 60 * hours; - hours = modulo(hours, 1000) + hours = fmod(hours, 1000) self.times[nextIndex] = string.format("%.2d:%.2d:%06.3f", hours, minutes, seconds); self.timeSinceLast[nextIndex] = 0; self.framesSinceLast[nextIndex] = 0;