summaryrefslogtreecommitdiffstats
path: root/acf/persistence/backends/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'acf/persistence/backends/files.lua')
-rw-r--r--acf/persistence/backends/files.lua12
1 files changed, 6 insertions, 6 deletions
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 = {}