From a178abfae615de4b06de3e0e9956bd0aa242416c Mon Sep 17 00:00:00 2001 From: jedireza Date: Sat, 29 Oct 2016 15:54:27 -0700 Subject: [PATCH] lib: change == to === in linkedlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also removed a TODO comment that is no longer viable and left a note about the potentially confusing property naming convention for future readers. PR-URL: https://github.com/nodejs/node/pull/9362 Reviewed-By: Rich Trott Reviewed-By: Brian White Reviewed-By: Bryan English Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Michaƫl Zasso Reviewed-By: Roman Reiss --- lib/internal/linkedlist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/linkedlist.js b/lib/internal/linkedlist.js index 15f06c0efe8f05..40bca91de25803 100644 --- a/lib/internal/linkedlist.js +++ b/lib/internal/linkedlist.js @@ -16,7 +16,7 @@ exports.create = create; // show the most idle item function peek(list) { - if (list._idlePrev == list) return null; + if (list._idlePrev === list) return null; return list._idlePrev; } exports.peek = peek; @@ -54,7 +54,7 @@ function append(list, item) { } // items are linked with _idleNext -> (older) and _idlePrev -> (newer) - // TODO: swap the linkage to match the intuitive older items at "prev" + // Note: This linkage (next being older) may seem counter-intuitive at first. item._idleNext = list._idleNext; item._idlePrev = list;