From 041300fde7dccf96e776e2cad07bee82f8a38a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Mon, 3 Nov 2014 18:13:35 +0100 Subject: [PATCH] Performance hack until I can properly address the speed issues in the Lua implementation of Lua's pattern matching. Should fix #648 for now. --- src/main/resources/assets/opencomputers/lua/kernel.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/assets/opencomputers/lua/kernel.lua b/src/main/resources/assets/opencomputers/lua/kernel.lua index 98382f573..319d55fdf 100644 --- a/src/main/resources/assets/opencomputers/lua/kernel.lua +++ b/src/main/resources/assets/opencomputers/lua/kernel.lua @@ -577,7 +577,7 @@ do checkArg(3, repl, "number", "string", "function", "table") checkArg(4, n, "number", "nil") - if #s < SHORT_STRING then + if #s < SHORT_STRING or type(repl) == "function" then return string_gsub(s, pattern, repl, n) end