mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
Merge pull request #18 from mpeterv/remove-redundant-function
Remove redundant `escapeChar` function
This commit is contained in:
commit
47e186d1e2
@ -45,10 +45,8 @@ local controlCharsTranslation = {
|
|||||||
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v"
|
["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v"
|
||||||
}
|
}
|
||||||
|
|
||||||
local function escapeChar(c) return controlCharsTranslation[c] end
|
|
||||||
|
|
||||||
local function escape(str)
|
local function escape(str)
|
||||||
local result = str:gsub("\\", "\\\\"):gsub("(%c)", escapeChar)
|
local result = str:gsub("\\", "\\\\"):gsub("(%c)", controlCharsTranslation)
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user