Returns a reference to the value corresponding to the key.
(&self, key: K)
| 97 | |
| 98 | /// Returns a reference to the value corresponding to the key. |
| 99 | pub fn get(&self, key: K) -> Option<&V> { |
| 100 | if let Some(idx) = self.sparse.get(key).cloned() { |
| 101 | if let Some(entry) = self.dense.get(idx as usize) { |
| 102 | if entry.key() == key { |
| 103 | return Some(entry); |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | None |
| 108 | } |
| 109 | |
| 110 | /// Returns a mutable reference to the value corresponding to the key. |
| 111 | /// |
no test coverage detected