Skip to content

Commit

Permalink
perf squeezing
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Dec 26, 2023
1 parent 9a93698 commit 9fb9513
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function parse (value, root, parent, rule, rules, rulesets, pseudo, point
// (
case 40:
if (charat(characters, length - 1) == 58) {
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(points[index - 1])) != -1)
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f', abs(index ? points[index - 1] : 0)) != -1)
ampersand = -1
break
}
Expand Down
4 changes: 2 additions & 2 deletions src/Prefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function prefix (value, length, children) {
// grid-(row|column)-start
case 4384: case 3616:
if (children && children.some(function (element, index) { return length = index, match(element.props, /grid-\w+-end/) })) {
return ~indexof(value + (children = children[length].value), 'span') ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span') ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';')
return ~indexof(value + (children = children[length].value), 'span', 0) ? value : (MS + replace(value, '-start', '') + value + MS + 'grid-row-span:' + (~indexof(children, 'span', 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ';')
}
return MS + replace(value, '-start', '') + value
// grid-(row|column)-end
Expand All @@ -113,7 +113,7 @@ export function prefix (value, length, children) {
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value
// (s)tretch
case 115:
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value
return ~indexof(value, 'stretch', 0) ? prefix(replace(value, 'stretch', 'fill-available'), length, children) + value : value
}
break
// grid-(column|row)
Expand Down

0 comments on commit 9fb9513

Please sign in to comment.