canonicalize.rs: Dedupe preference-based caching#376
canonicalize.rs: Dedupe preference-based caching#376glebm wants to merge 1 commit intodaisy:mainfrom
Conversation
Extracted from daisy#374.
|
I'm not seeing the why adding |
|
It's not about the amount of code but about eliminating the duplication. In the stateless PR, there is a new impl CanonicalizeContext {
pub fn new_uncached(pref_manager: &PreferenceManager) -> CanonicalizeContext {
return CanonicalizeContext {
patterns: Rc::new( CanonicalizeContextPatterns::new(
&CanonicalizeContextPatternsOptions::from_prefs(pref_manager)) ),
};
}The options struct also act as the cache key, making the equality comparison a simple
I don't think it does -- it's stored by value in |
Extracted from #374.