From 4c1cc6f54edc35a4aa2f1553bc9ce372a2b77695 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Fri, 28 Jun 2013 23:50:18 +0300 Subject: eliminate explicit use of string module --- acf/persistence/backends/files.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'acf/persistence/backends/files.lua') diff --git a/acf/persistence/backends/files.lua b/acf/persistence/backends/files.lua index b14ed10..7d03e12 100644 --- a/acf/persistence/backends/files.lua +++ b/acf/persistence/backends/files.lua @@ -17,9 +17,9 @@ local function get_scope(top) return end - return stringy.startswith(top.scope, '/files/') and string.sub( - top.scope, 7, -1 - ) or nil + return stringy.startswith( + top.scope, '/files/' + ) and top.scope:sub(7, -1) or nil end @@ -47,9 +47,9 @@ function backend:get(path, top) assert(scope) scope = scope..'/' - local slen = string.len(scope) - assert(string.sub(target, 1, slen) == scope) - return string.sub(target, slen + 1, -1) + local slen = scope:len() + assert(target:sub(1, slen) == scope) + return target:sub(slen + 1, -1) elseif t == 'directory' then local res = {} -- cgit v1.2.3