mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Minor style cleanups in Cache code
- Make ApplicableDeclarationsCache::cache priv - Add a missing semicolon for clarity - Remove a useless `drop` call.
This commit is contained in:
parent
33c4a7a5dc
commit
b7ba2157a1
2 changed files with 3 additions and 3 deletions
|
@ -131,7 +131,7 @@ impl<'a> Hash for ApplicableDeclarationsCacheQuery<'a> {
|
|||
static APPLICABLE_DECLARATIONS_CACHE_SIZE: uint = 32;
|
||||
|
||||
pub struct ApplicableDeclarationsCache {
|
||||
pub cache: SimpleHashCache<ApplicableDeclarationsCacheEntry,Arc<ComputedValues>>,
|
||||
cache: SimpleHashCache<ApplicableDeclarationsCacheEntry,Arc<ComputedValues>>,
|
||||
}
|
||||
|
||||
impl ApplicableDeclarationsCache {
|
||||
|
@ -149,7 +149,7 @@ impl ApplicableDeclarationsCache {
|
|||
}
|
||||
|
||||
fn insert(&mut self, declarations: &[MatchedProperty], style: Arc<ComputedValues>) {
|
||||
drop(self.cache.insert(ApplicableDeclarationsCacheEntry::new(declarations), style))
|
||||
self.cache.insert(ApplicableDeclarationsCacheEntry::new(declarations), style)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ impl<K:Clone+Eq+Hash,V:Clone> SimpleHashCache<K,V> {
|
|||
impl<K:Clone+Eq+Hash,V:Clone> Cache<K,V> for SimpleHashCache<K,V> {
|
||||
fn insert(&mut self, key: K, value: V) {
|
||||
let bucket_index = self.bucket_for_key(&key);
|
||||
*self.entries.get_mut(bucket_index) = Some((key, value))
|
||||
*self.entries.get_mut(bucket_index) = Some((key, value));
|
||||
}
|
||||
|
||||
fn find(&mut self, key: &K) -> Option<V> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue