static int *uid_hash_table_sort_idx;
/** The number of used slots in the hash table. */
-static uint32_t num_uids = 0;
+static uint32_t num_uids;
/*
* The columns of the per-user tables.
/*
* We use a hash table of size s=2^uid_hash_bits to map the uids into the
- * interval [0..s]. Hash collisions are treated by open addressing, i.e.
+ * interval [0..s-1]. Hash collisions are treated by open addressing, i.e.
* unused slots in the table are used to store different uids that hash to the
* same slot.
*
* An odd number is sufficient to make sure each entry of the hash table gets
* probed for probe_num between 0 and s-1 because s is a power of two, hence
* the second hash value has never a common divisor with the hash table size.
- * IOW: h is invertible in the ring [0..s].
+ * IOW: h is invertible in the ring [0..s-1].
*/
static uint32_t double_hash(uint32_t uid, uint32_t probe_num)
{
FOR_EACH_USER(ui) {
int ret;
- if (!ui_used(ui)) {
+ if (!ui_used(ui))
continue;
- }
if (!uid_is_admissible(ui->uid, admissible_uids)) {
DEBUG_LOG("uid %u is not admissible\n", ui->uid);
ui->flags &= ~UI_FL_ADMISSIBLE;