Skip to content

Commit 94e7d49

Browse files
committed
Rename functions from entry to node
1 parent 5cf1616 commit 94e7d49

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl<K, V> Node<K, V> {
106106
}
107107
}
108108

109-
unsafe fn drop_empty_entry_box<K, V>(the_box: *mut Node<K, V>) {
109+
unsafe fn drop_empty_node<K, V>(the_box: *mut Node<K, V>) {
110110
// Prevent compiler from trying to drop the un-initialized key and values in the node.
111111
let Node { key, value, .. } = *Box::from_raw(the_box);
112112
mem::forget(key);
@@ -139,7 +139,7 @@ impl<K, V, S> LinkedHashMap<K, V, S> {
139139
let mut free = self.free;
140140
while ! free.is_null() {
141141
let next_free = (*free).next;
142-
drop_empty_entry_box(free);
142+
drop_empty_node(free);
143143
free = next_free;
144144
}
145145
self.free = ptr::null_mut();
@@ -742,7 +742,7 @@ impl<K, V, S> Drop for LinkedHashMap<K, V, S> {
742742
if !self.head.is_null() {
743743
unsafe {
744744
self.drop_entries();
745-
drop_empty_entry_box(self.head);
745+
drop_empty_node(self.head);
746746
}
747747
}
748748
self.clear_free_list();
@@ -797,7 +797,7 @@ impl<K, V> Clone for IntoIter<K, V> where K: Clone, V: Clone {
797797
return IntoIter { ..*self }
798798
}
799799

800-
fn clone_entry<K, V>(e: *mut Node<K, V>) -> *mut Node<K, V>
800+
fn clone_node<K, V>(e: *mut Node<K, V>) -> *mut Node<K, V>
801801
where K: Clone, V: Clone,
802802
{
803803
Box::into_raw(Box::new(Node::new(
@@ -806,11 +806,11 @@ impl<K, V> Clone for IntoIter<K, V> where K: Clone, V: Clone {
806806
}
807807

808808
let mut cur = self.head;
809-
let head = clone_entry(cur);
809+
let head = clone_node(cur);
810810
let mut tail = head;
811811
for _ in 1..self.remaining {
812812
unsafe {
813-
(*tail).prev = clone_entry((*cur).prev);
813+
(*tail).prev = clone_node((*cur).prev);
814814
(*(*tail).prev).next = tail;
815815
tail = (*tail).prev;
816816
cur = (*cur).prev;
@@ -1030,7 +1030,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> IntoIterator for LinkedHashMap<K, V, S> {
10301030
let len = self.len();
10311031

10321032
if !self.head.is_null() {
1033-
unsafe { drop_empty_entry_box(self.head) }
1033+
unsafe { drop_empty_node(self.head) }
10341034
}
10351035
self.clear_free_list();
10361036
// drop the HashMap but not the LinkedHashMap

0 commit comments

Comments
 (0)