Comparison

mod_storage_gdbm/mod_storage_gdbm.lua @ 1602:3912a53fd4db

mod_storage_gdbm: Get 'after' parameter from correct table
author Kim Alvefur <zash@zash.se>
date Sat, 07 Feb 2015 22:22:15 +0100
parent 1596:b362e6c00fd1
child 1603:1fbec16996f5
comparison
equal deleted inserted replaced
1601:c5ca63ac0e1b 1602:3912a53fd4db
77 77
78 function archive:find(username, query) 78 function archive:find(username, query)
79 local meta = self:get(username); 79 local meta = self:get(username);
80 local r = query.reverse; 80 local r = query.reverse;
81 local d = r and -1 or 1; 81 local d = r and -1 or 1;
82 local s = meta[ifelse(r, query.before, meta.after)]; 82 local s = meta[ifelse(r, query.before, query.after)];
83 if s then 83 if s then
84 s = s + d; 84 s = s + d;
85 else 85 else
86 s = ifelse(r, #meta, 1) 86 s = ifelse(r, #meta, 1)
87 end 87 end