mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Use Buffer.equals not Buffer.compare for node 4+
This commit is contained in:
parent
b1896e3737
commit
7cb9b2da66
@ -94,7 +94,7 @@ function compareObjects(obj1,obj2) {
|
|||||||
if (isBuffer1 && isBuffer2) {
|
if (isBuffer1 && isBuffer2) {
|
||||||
if (Buffer.compare) {
|
if (Buffer.compare) {
|
||||||
// For node 4.x+ - use the native compare
|
// For node 4.x+ - use the native compare
|
||||||
return Buffer.compare(obj1,obj2);
|
return Buffer.equals(obj1,obj2);
|
||||||
} else {
|
} else {
|
||||||
if (obj1.length !== obj2.length) {
|
if (obj1.length !== obj2.length) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user