File tree Expand file tree Collapse file tree 7 files changed +10
-1
lines changed Expand file tree Collapse file tree 7 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change 1010
1111- Avoid unnecessary check for double quotes.
1212- Avoid creating an unnecessary string cache entry.
13+ - Use a more precise estimate for the size of the number of applied styles.
1314
1415## [ 0.16.0] - 2025-07-16
1516
Original file line number Diff line number Diff line change @@ -426,7 +426,6 @@ impl<'a> CSSInliner<'a> {
426426 if let Some ( css) = css {
427427 raw_styles. push_str ( css) ;
428428 }
429- let mut styles = IndexMap :: with_capacity_and_hasher ( 128 , BuildNoHashHasher :: default ( ) ) ;
430429 let mut parse_input = cssparser:: ParserInput :: new ( & raw_styles) ;
431430 let mut parser = cssparser:: Parser :: new ( & mut parse_input) ;
432431 // Allocating some memory for all the parsed declarations
@@ -469,6 +468,10 @@ impl<'a> CSSInliner<'a> {
469468 } else {
470469 None
471470 } ;
471+ let mut styles = IndexMap :: with_capacity_and_hasher (
472+ document. elements . len ( ) . max ( 16 ) ,
473+ BuildNoHashHasher :: default ( ) ,
474+ ) ;
472475 // This cache is unused but required in the `selectors` API
473476 let mut caches = SelectorCaches :: default ( ) ;
474477 for ( selectors, ( start, end) ) in & rule_list {
You can’t perform that action at this time.
0 commit comments