Skip to content

Commit 4368352

Browse files
committed
Merge pull request reworkcss#55 from brettstimmerman/chore/perf-improvements
Performance improvements to atrule() and trim() fns
2 parents eca598f + f83bdbd commit 4368352

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,8 @@ module.exports = function(css, options){
450450
*/
451451

452452
function atrule() {
453+
if (css[0] != '@') return;
454+
453455
return atkeyframes()
454456
|| atmedia()
455457
|| atsupports()
@@ -487,5 +489,5 @@ module.exports = function(css, options){
487489
*/
488490

489491
function trim(str) {
490-
return (str || '').replace(/^\s+|\s+$/g, '');
492+
return str ? str.replace(/^\s+|\s+$/g, '') : '';
491493
}

0 commit comments

Comments
 (0)