Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use self::Entry::*;
use self::VacantEntryState::*;

use intrinsics::unlikely;
use collections::CollectionAllocErr;
use cell::Cell;
use borrow::Borrow;
Expand Down Expand Up @@ -1992,6 +1993,9 @@ impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S>
fn search<F>(self, hash: u64, is_match: F, compare_hashes: bool) -> Option<(&'a K, &'a V)>
where F: FnMut(&K) -> bool
{
if unsafe { unlikely(self.map.table.size() == 0) } {
return None;
}
match search_hashed_nonempty(&self.map.table,
SafeHash::new(hash),
is_match,
Expand Down