Skip to content

Commit 7d61d2f

Browse files
committed
refactor: simplify a line
1 parent 6d89df0 commit 7d61d2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fallback/encoding.util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function unfinishedBytes(u, len, enc) {
2323
let p = 0
2424
if (len % 2 !== 0) p++ // uneven bytes
2525
const l = len - p - 1
26-
if (len - p >= 2) {
26+
if (l >= 1) {
2727
const last = enc === 'utf-16le' ? (u[l] << 8) ^ u[l - 1] : (u[l - 1] << 8) ^ u[l]
2828
if (last >= 0xd8_00 && last < 0xdc_00) p += 2 // lone lead
2929
}

0 commit comments

Comments
 (0)