mirror of https://github.com/nodejs/node.git
buffer: remove unnecessary argument check
In Buffer.prototype.compare, the first check makes sure that target is an instance of Buffer. The value cannot be falsy after that so we can safely get its length. PR-URL: https://github.com/nodejs/node/pull/8552 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>pull/8552/head
parent
4c76881383
commit
05886cbab1
|
@ -539,7 +539,7 @@ Buffer.prototype.compare = function compare(target,
|
|||
if (start === undefined)
|
||||
start = 0;
|
||||
if (end === undefined)
|
||||
end = target ? target.length : 0;
|
||||
end = target.length;
|
||||
if (thisStart === undefined)
|
||||
thisStart = 0;
|
||||
if (thisEnd === undefined)
|
||||
|
|
Loading…
Reference in New Issue