Skip to content
  • Faith Ekstrand's avatar
    util/hash_table: Do a full search when adding new items · c9287e79
    Faith Ekstrand authored
    
    
    Previously, the hash_table_insert function would bail early if it found a
    deleted slot that it could re-use.  However, this is a problem if the key
    being inserted is already in the hash table but further down the list.  If
    this happens, the element ends up getting inserted in the hash table twice.
    This commit makes it so that we walk over all of the possible entries for
    the given key and then, if we don't find the key, place it in the available
    free entry we found.
    
    Reviewed-by: default avatarEric Anholt <eric@anholt.net>
    c9287e79