summaryrefslogtreecommitdiffstats
path: root/acf/persistence/backends/volatile.lua
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2013-05-01 11:44:11 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2013-05-01 14:11:00 +0300
commitb5cf596d6c17fc9c8b7c679fe445a9c70af2a16e (patch)
treeaa649c1ff98961f1b6bbc1fef983a8ee9adc1c07 /acf/persistence/backends/volatile.lua
parent8a1ecf4ef917a47119c269f3adcf78cf082e0e55 (diff)
downloadaconf-b5cf596d6c17fc9c8b7c679fe445a9c70af2a16e.tar.bz2
aconf-b5cf596d6c17fc9c8b7c679fe445a9c70af2a16e.tar.xz
allow numerical components in path names
use escape syntax to encode number-looking strings
Diffstat (limited to 'acf/persistence/backends/volatile.lua')
-rw-r--r--acf/persistence/backends/volatile.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/acf/persistence/backends/volatile.lua b/acf/persistence/backends/volatile.lua
index 165e7fc..339f937 100644
--- a/acf/persistence/backends/volatile.lua
+++ b/acf/persistence/backends/volatile.lua
@@ -24,7 +24,7 @@ function backend:_get(path)
for _, comp in ipairs(path) do
if res == nil then return end
assert(type(res) == 'table')
- res = res[tonumber(comp) or comp]
+ res = res[comp]
end
return res
end
@@ -43,7 +43,7 @@ function backend:_set(path, tpe, value)
local comps = copy(path)
local name = comps[#comps]
table.remove(comps)
- self:_get(comps)[tonumber(name) or name] = value
+ self:_get(comps)[name] = value
end
end