Skip to content

Commit 0c44394

Browse files
committed
perf: improve splitSelector speed a little
1 parent c77b11b commit 0c44394

7 files changed

+7
-3
lines changed

.commithash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f8c482f099a597ffb1d3f43d6ca36947e64fb666
1+
c77b11b6bf023afd4cea7f30147e05027d21d0e5

dist/cssobj-plugin-localize.amd.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function arrayKV (obj, k, v, reverse, unique) {
5151

5252
// split selector with splitter, aware of css attributes
5353
function splitSelector (sel, splitter) {
54+
if (sel.indexOf(splitter) < 0) return [sel]
5455
for (var c, i = 0, n = 0, instr = '', prev = 0, d = []; c = sel.charAt(i); i++) {
5556
if (instr) {
5657
if (c == instr) instr = '';

dist/cssobj-plugin-localize.cjs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function arrayKV (obj, k, v, reverse, unique) {
5151

5252
// split selector with splitter, aware of css attributes
5353
function splitSelector (sel, splitter) {
54+
if (sel.indexOf(splitter) < 0) return [sel]
5455
for (var c, i = 0, n = 0, instr = '', prev = 0, d = []; c = sel.charAt(i); i++) {
5556
if (instr) {
5657
if (c == instr) instr = '';

dist/cssobj-plugin-localize.es.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function arrayKV (obj, k, v, reverse, unique) {
4949

5050
// split selector with splitter, aware of css attributes
5151
function splitSelector (sel, splitter) {
52+
if (sel.indexOf(splitter) < 0) return [sel]
5253
for (var c, i = 0, n = 0, instr = '', prev = 0, d = []; c = sel.charAt(i); i++) {
5354
if (instr) {
5455
if (c == instr) instr = '';

dist/cssobj-plugin-localize.iife.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function arrayKV (obj, k, v, reverse, unique) {
5252

5353
// split selector with splitter, aware of css attributes
5454
function splitSelector (sel, splitter) {
55+
if (sel.indexOf(splitter) < 0) return [sel]
5556
for (var c, i = 0, n = 0, instr = '', prev = 0, d = []; c = sel.charAt(i); i++) {
5657
if (instr) {
5758
if (c == instr) instr = '';

dist/cssobj-plugin-localize.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cssobj-plugin-localize",
3-
"version": "3.2.1",
3+
"version": "3.2.2",
44
"description": "Localize class name for cssobj",
55
"main": "dist/cssobj-plugin-localize.cjs.js",
66
"browser": "dist/cssobj-plugin-localize.iife.js",

0 commit comments

Comments
 (0)