From 558c97a962d596becf1ec1d7d9c88a6239e1627b Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 20 Jun 2020 23:10:12 +0800 Subject: remove some ifelse --- xmake/core/sandbox/modules/string.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmake/core/sandbox/modules/string.lua') diff --git a/xmake/core/sandbox/modules/string.lua b/xmake/core/sandbox/modules/string.lua index 36f2f7b58..755b12fba 100644 --- a/xmake/core/sandbox/modules/string.lua +++ b/xmake/core/sandbox/modules/string.lua @@ -48,7 +48,7 @@ function sandbox_string.vformat(format, ...) if #{...} > 0 then -- escape "%$", "%(", "%)", "%%" to '$', '(', ')', '%%' - format = format:gsub("%%([%$%(%)%%])", function (ch) return utils.ifelse(ch ~= "%", "%%" .. ch, "%%%%") end) + format = format:gsub("%%([%$%(%)%%])", function (ch) return ch ~= "%" and ("%%" .. ch) or "%%%%" end) -- try to format it result = string.format(format, ...) -- cgit v1.3.1