Skip to content

Commit d01427f

Browse files
committed
[test] Add some #[inline] to HashMap
1 parent 1af1c2d commit d01427f

File tree

1 file changed

+3
-0
lines changed
  • src/libstd/collections/hash

1 file changed

+3
-0
lines changed

src/libstd/collections/hash/map.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,7 @@ impl<K, V, S> HashMap<K, V, S>
11131113
/// assert_eq!(map.get(&2), None);
11141114
/// ```
11151115
#[stable(feature = "rust1", since = "1.0.0")]
1116+
#[inline]
11161117
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
11171118
where K: Borrow<Q>,
11181119
Q: Hash + Eq
@@ -2554,6 +2555,7 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
25542555
{
25552556
type Key = K;
25562557

2558+
#[inline]
25572559
fn get(&self, key: &Q) -> Option<&K> {
25582560
self.search(key).into_occupied_bucket().map(|bucket| bucket.into_refs().0)
25592561
}
@@ -2566,6 +2568,7 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
25662568
self.search_mut(key).into_occupied_bucket().map(|bucket| pop_internal(bucket).0)
25672569
}
25682570

2571+
#[inline]
25692572
fn replace(&mut self, key: K) -> Option<K> {
25702573
self.reserve(1);
25712574

0 commit comments

Comments
 (0)