Merge pull request #18 from mpeterv/remove-redundant-function

Remove redundant `escapeChar` function
master
Enrique García 10 years ago
commit 47e186d1e2
  1. 4
      inspect.lua

@ -45,10 +45,8 @@ local controlCharsTranslation = {
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v"
}
local function escapeChar(c) return controlCharsTranslation[c] end
local function escape(str)
local result = str:gsub("\\", "\\\\"):gsub("(%c)", escapeChar)
local result = str:gsub("\\", "\\\\"):gsub("(%c)", controlCharsTranslation)
return result
end

Loading…
Cancel
Save