about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-10-20 11:40:04 -0700
committerAlex Crichton <alex@alexcrichton.com>2017-10-20 11:49:36 -0700
commitd01427f53e81a24e1c49d1672f37d4809c04a004 (patch)
treec5f5456e103574f237cb7d1ffa77263661e52916 /src
parent1af1c2de36d39c5e24846d74f1ae549499bab70d (diff)
downloadrust-d01427f53e81a24e1c49d1672f37d4809c04a004.tar.gz
rust-d01427f53e81a24e1c49d1672f37d4809c04a004.zip
[test] Add some `#[inline]` to `HashMap`
Diffstat (limited to 'src')
-rw-r--r--src/libstd/collections/hash/map.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index 3c0fa0860d3..d96a4f40d3f 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -1113,6 +1113,7 @@ impl<K, V, S> HashMap<K, V, S>
     /// assert_eq!(map.get(&2), None);
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[inline]
     pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
         where K: Borrow<Q>,
               Q: Hash + Eq
@@ -2554,6 +2555,7 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
 {
     type Key = K;
 
+    #[inline]
     fn get(&self, key: &Q) -> Option<&K> {
         self.search(key).into_occupied_bucket().map(|bucket| bucket.into_refs().0)
     }
@@ -2566,6 +2568,7 @@ impl<K, S, Q: ?Sized> super::Recover<Q> for HashMap<K, (), S>
         self.search_mut(key).into_occupied_bucket().map(|bucket| pop_internal(bucket).0)
     }
 
+    #[inline]
     fn replace(&mut self, key: K) -> Option<K> {
         self.reserve(1);