Comparison

plugins/mod_storage_memory.lua @ 9340:368b092bf4bf

mod_storage_memory: Fix saving of remaining items during deletion All data is compiled into functions that return new copies in order to prevent mutation of stored data. This has downsides. Also an ugly hack.
author Kim Alvefur <zash@zash.se>
date Sat, 22 Sep 2018 16:03:50 +0200
parent 9293:0a751835627d
child 9468:bd5e4485a245
comparison
equal deleted inserted replaced
9339:a35a636481c6 9340:368b092bf4bf
126 local t; 126 local t;
127 for i = 1, #old do 127 for i = 1, #old do
128 i = old[i]; 128 i = old[i];
129 t = i.when; 129 t = i.when;
130 if not(qstart >= t and qend <= t and (not qwith or i.with == qwith)) then 130 if not(qstart >= t and qend <= t and (not qwith or i.with == qwith)) then
131 self:append(username, i.key, i.value, t, i.with); 131 self:append(username, i.key, i.value(), t, i.with);
132 end 132 end
133 end 133 end
134 if #new == 0 then 134 if #new == 0 then
135 self.store[username or NULL] = nil; 135 self.store[username or NULL] = nil;
136 end 136 end