# HG changeset patch # User John@Doomsday # Date 1336050291 14400 # Node ID 25c127c4c1e8482a30959c4b92194b6c1587fc8e # Parent 790266dbcaff43b4d4500dc78dd75be130c8e432 Cleanup. Notes. Always use ipairs on changes table - no guarantee of ordering with pairs diff -r 790266dbcaff -r 25c127c4c1e8 Lists.lua --- a/Lists.lua Thu May 03 09:04:21 2012 -0400 +++ b/Lists.lua Thu May 03 09:04:51 2012 -0400 @@ -929,7 +929,7 @@ local j = 1 -- index in foreign list local n = getn(t) local o = {} - for i,v in pairs(db.profile.changes) do -- for each timestamp in our list + for i,v in ipairs(db.profile.changes) do -- for each timestamp in our list if t and t[j] < v.time then table.insert(o,v) end @@ -937,9 +937,6 @@ end -- j>=n ? add because the remote hit end of road. lt? add because it's a missing stamp --print("Received request at timebase",remoteBase,"and returning:") --PrintTable(o) - if getn(o) > 0 then - Send("CU",o) -- todo: send privately to the requster - end return true, o else return false, {} @@ -962,7 +959,7 @@ db.profile.changes = c else while op <= no or cp <= nc do -- lists are pre-sorted. insertion merge them - if cp > nc then -- inelegant + if cp > nc then -- inelegant - edge cases first, then the normal logic table.insert(new,old[op]) op = op + 1 elseif op > no then