From f934e995d6f871c3ca269835b2f990f63055c9fc Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 11 Mar 2017 13:27:53 +0100 Subject: [PATCH] don't populate sync record map with invalid UIDs this would obviously just bloat the hash with nonsense, slowing down the actual lookup later. --- src/sync.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sync.c b/src/sync.c index 835547a..485e419 100644 --- a/src/sync.c +++ b/src/sync.c @@ -1356,6 +1356,8 @@ box_loaded( int sts, void *aux ) if (srec->status & S_DEAD) continue; uid = srec->uid[t]; + if (uid <= 0) + continue; idx = (uint)((uint)uid * 1103515245U) % hashsz; while (srecmap[idx].uid) if (++idx == hashsz)