Fix comparison of Buffers (again)

This commit is contained in:
Nick O'Leary 2016-04-01 10:32:11 +01:00
parent 7cb9b2da66
commit 1d54761d48
1 changed files with 3 additions and 3 deletions

View File

@ -92,9 +92,9 @@ function compareObjects(obj1,obj2) {
return false;
}
if (isBuffer1 && isBuffer2) {
if (Buffer.compare) {
// For node 4.x+ - use the native compare
return Buffer.equals(obj1,obj2);
if (obj1.equals) {
// For node 0.12+ - use the native equals
return obj1.equals(obj2);
} else {
if (obj1.length !== obj2.length) {
return false;