Skip to content

Commit

Permalink
[Refactor] utils: use +=
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 12, 2024
1 parent c4d29f3 commit 572533c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
}

if (c < 0x80) {
out = out + hexTable[c];
out += hexTable[c];
continue;
}

if (c < 0x800) {
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
out += hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)];
continue;
}

if (c < 0xD800 || c >= 0xE000) {
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
out += hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)];
continue;
}

Expand Down

0 comments on commit 572533c

Please sign in to comment.