Skip to content

Commit 389af5a

Browse files
committed
[squash] remove indentation for the fast case
1 parent a65a5c3 commit 389af5a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/buffer.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -569,28 +569,28 @@ Buffer.prototype.copy = function(target, targetStart, sourceStart, sourceEnd) {
569569
Buffer.prototype.toString = function(encoding, start, end) {
570570
if (arguments.length === 0) {
571571
return this.utf8Slice(0, this.length);
572-
} else {
573-
const len = this.length;
574-
if (len === 0)
575-
return '';
572+
}
576573

577-
if (!start || start < 0)
578-
start = 0;
579-
else if (start >= len)
580-
return '';
574+
const len = this.length;
575+
if (len === 0)
576+
return '';
581577

582-
if (end === undefined || end > len)
583-
end = len;
584-
else if (end <= 0)
585-
return '';
578+
if (!start || start < 0)
579+
start = 0;
580+
else if (start >= len)
581+
return '';
586582

587-
start |= 0;
588-
end |= 0;
583+
if (end === undefined || end > len)
584+
end = len;
585+
else if (end <= 0)
586+
return '';
589587

590-
if (end <= start)
591-
return '';
592-
return stringSlice(this, encoding, start, end);
593-
}
588+
start |= 0;
589+
end |= 0;
590+
591+
if (end <= start)
592+
return '';
593+
return stringSlice(this, encoding, start, end);
594594
};
595595

596596

0 commit comments

Comments
 (0)