MCPcopy Create free account
hub / github.com/apache/datafusion / pop

Method pop

datafusion/execution/src/cache/lru_queue.rs:138–152  ·  view source on GitHub ↗

Removes and returns the least recently used value. Returns `None` if the queue is empty.

(&mut self)

Source from the content-addressed store, hash-verified

136 /// Removes and returns the least recently used value.
137 /// Returns `None` if the queue is empty.
138 pub fn pop(&mut self) -> Option<(K, V)> {
139 let key_to_remove = self.queue.tail.as_ref().map(|n| {
140 n.upgrade()
141 .expect("value has been unexpectedly dropped")
142 .lock()
143 .key
144 .clone()
145 });
146 if let Some(k) = key_to_remove {
147 let value = self.remove(&k).unwrap(); // confirmed above that the entry exists
148 Some((k, value))
149 } else {
150 None
151 }
152 }
153
154 /// Removes a specific entry from the queue, if it exists.
155 pub fn remove(&mut self, key: &K) -> Option<V> {

Callers 11

iter_conjunctionFunction · 0.45
iter_conjunction_ownedFunction · 0.45
remove_scopeFunction · 0.45
f_upMethod · 0.45
with_new_exprsMethod · 0.45
mark_fieldFunction · 0.45
runMethod · 0.45
test_fuzzyFunction · 0.45
evict_entriesMethod · 0.45
evict_entriesMethod · 0.45
evict_entriesMethod · 0.45

Calls 4

mapMethod · 0.45
as_refMethod · 0.45
cloneMethod · 0.45
removeMethod · 0.45

Tested by 1

test_fuzzyFunction · 0.36