Rollup merge of #56561 - Zoxc:too-raw, r=Gankro
Fix bug in from_key_hashed_nocheck
This commit is contained in:
commit
06f3b57633
1 changed files with 4 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
use self::Entry::*;
|
||||
use self::VacantEntryState::*;
|
||||
|
||||
use intrinsics::unlikely;
|
||||
use collections::CollectionAllocErr;
|
||||
use cell::Cell;
|
||||
use borrow::Borrow;
|
||||
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue