aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/cache.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/cache.rs')
-rw-r--r--components/style/cache.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/style/cache.rs b/components/style/cache.rs
index 8e4c7371938..013c267c165 100644
--- a/components/style/cache.rs
+++ b/components/style/cache.rs
@@ -39,8 +39,7 @@ impl<K: Array> LRUCache<K> {
#[inline]
/// Touch a given entry, putting it first in the list.
pub fn touch(&mut self, pos: usize) {
- let last_index = self.entries.len() - 1;
- if pos != last_index {
+ if pos != 0 {
let entry = self.entries.remove(pos).unwrap();
self.entries.push_front(entry);
}