Skip to content

Commit 01a3773

Browse files
author
Ruben Bridgewater
committed
Use type safe comparison
1 parent 0908e9a commit 01a3773

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

diff_multi_bench_output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ before_lines.forEach(function(b, i) {
4949
var isNaN = !num && num !== 0;
5050
return !isNaN;
5151
});
52-
if (ops.length != 2) return;
52+
if (ops.length !== 2) return;
5353

5454
var delta = ops[1] - ops[0];
5555
var pct = ((delta / ops[0]) * 100).toPrecision(3);
@@ -60,7 +60,7 @@ before_lines.forEach(function(b, i) {
6060
pct = humanize_diff(pct, '%');
6161
console.log(
6262
// name of test
63-
command_name(a_words) == command_name(b_words)
63+
command_name(a_words) === command_name(b_words)
6464
? command_name(a_words) + ':'
6565
: '404:',
6666
// results of test

test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ tests.FLUSHDB = function () {
204204
tests.INCR = function () {
205205
var name = "INCR";
206206

207-
if (bclient.reply_parser.name == "hiredis") {
207+
if (bclient.reply_parser.name === "hiredis") {
208208
console.log("Skipping INCR buffer test with hiredis");
209209
return next(name);
210210
}
@@ -371,7 +371,7 @@ tests.MULTI_6 = function () {
371371
tests.MULTI_7 = function () {
372372
var name = "MULTI_7";
373373

374-
if (bclient.reply_parser.name != "javascript") {
374+
if (bclient.reply_parser.name !== "javascript") {
375375
console.log("Skipping wire-protocol test for 3rd-party parser");
376376
return next(name);
377377
}
@@ -467,7 +467,7 @@ tests.FWD_ERRORS_1 = function () {
467467

468468
client3.on("message", function (channel, data) {
469469
console.log("incoming");
470-
if (channel == name) {
470+
if (channel === name) {
471471
assert.equal(data, "Some message");
472472
throw toThrow;
473473
}
@@ -1286,11 +1286,11 @@ tests.SUBSCRIBE_CLOSE_RESUBSCRIBE = function () {
12861286
console.log("c1 is ready", count);
12871287

12881288
count++;
1289-
if (count == 1) {
1289+
if (count === 1) {
12901290
c2.publish("chan1", "hi on channel 1");
12911291
return;
12921292

1293-
} else if (count == 2) {
1293+
} else if (count === 2) {
12941294
c2.publish("chan2", "hi on channel 2");
12951295

12961296
} else {

0 commit comments

Comments
 (0)