Переглянути джерело

don't populate sync record map with invalid UIDs

this would obviously just bloat the hash with nonsense, slowing down the
actual lookup later.
Oswald Buddenhagen 8 роки тому
батько
коміт
f934e995d6
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      src/sync.c

+ 2 - 0
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)