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 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change 10
10
11
11
- Avoid unnecessary check for double quotes.
12
12
- Avoid creating an unnecessary string cache entry.
13
+ - Use a more precise estimate for the size of the number of applied styles.
13
14
14
15
## [ 0.16.0] - 2025-07-16
15
16
Original file line number Diff line number Diff line change @@ -426,7 +426,6 @@ impl<'a> CSSInliner<'a> {
426
426
if let Some ( css) = css {
427
427
raw_styles. push_str ( css) ;
428
428
}
429
- let mut styles = IndexMap :: with_capacity_and_hasher ( 128 , BuildNoHashHasher :: default ( ) ) ;
430
429
let mut parse_input = cssparser:: ParserInput :: new ( & raw_styles) ;
431
430
let mut parser = cssparser:: Parser :: new ( & mut parse_input) ;
432
431
// Allocating some memory for all the parsed declarations
@@ -469,6 +468,10 @@ impl<'a> CSSInliner<'a> {
469
468
} else {
470
469
None
471
470
} ;
471
+ let mut styles = IndexMap :: with_capacity_and_hasher (
472
+ document. elements . len ( ) . max ( 16 ) ,
473
+ BuildNoHashHasher :: default ( ) ,
474
+ ) ;
472
475
// This cache is unused but required in the `selectors` API
473
476
let mut caches = SelectorCaches :: default ( ) ;
474
477
for ( selectors, ( start, end) ) in & rule_list {
You can’t perform that action at this time.
0 commit comments