Skip to content

Commit

Permalink
Use loop for =
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Oct 2, 2024
1 parent cbc94b4 commit eca9f8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ function parse(str, options) {
var index = 0;

while (index < str.length) {
var eqIdx = str.indexOf('=', index);
if (eqIdx === -1) break;

var endIdx = str.indexOf(';', index);
if (endIdx === -1) endIdx = str.length;

if (eqIdx > endIdx) {
var eqIdx = index;
while (eqIdx < endIdx && str.charCodeAt(eqIdx) !== 0x3D /* = */) eqIdx++;

if (eqIdx === endIdx) {
index = endIdx + 1;
continue;
}
Expand Down

0 comments on commit eca9f8f

Please sign in to comment.