Skip to content

Commit 9ee9577

Browse files
committed
perf: Only check the value suffix for !important
Signed-off-by: Dmitry Dygalo <[email protected]>
1 parent dcd2835 commit 9ee9577

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

css-inline/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ impl<'a> CSSInliner<'a> {
462462
match element_styles.entry(name.as_ref()) {
463463
indexmap::map::Entry::Occupied(mut entry) => {
464464
match (
465-
value.contains("!important"),
466-
entry.get().1.contains("!important"),
465+
value.ends_with("!important"),
466+
entry.get().1.ends_with("!important"),
467467
) {
468468
// Equal importance; the higher specificity wins.
469469
(false, false) | (true, true) => {

0 commit comments

Comments
 (0)