Skip to content

Commit eca9f8f

Browse files
committed
Use loop for =
1 parent cbc94b4 commit eca9f8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ function parse(str, options) {
102102
var index = 0;
103103

104104
while (index < str.length) {
105-
var eqIdx = str.indexOf('=', index);
106-
if (eqIdx === -1) break;
107-
108105
var endIdx = str.indexOf(';', index);
109106
if (endIdx === -1) endIdx = str.length;
110107

111-
if (eqIdx > endIdx) {
108+
var eqIdx = index;
109+
while (eqIdx < endIdx && str.charCodeAt(eqIdx) !== 0x3D /* = */) eqIdx++;
110+
111+
if (eqIdx === endIdx) {
112112
index = endIdx + 1;
113113
continue;
114114
}

0 commit comments

Comments
 (0)