From f3c2d406f21f612b6bde61c18d56556ed80ffc85 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-jy Date: Fri, 22 Sep 2023 01:25:51 -0700 Subject: [PATCH] removed comments and spaces and ran lint fix --- lib/queryContextCache.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/lib/queryContextCache.js b/lib/queryContextCache.js index c68df3234..430e3a0e6 100644 --- a/lib/queryContextCache.js +++ b/lib/queryContextCache.js @@ -23,10 +23,8 @@ function QueryContextElement (id,timestamp,priority,context) { */ /** - * * @param {Number} capacity Maximum capacity of the cache. */ - function QueryContextCache (capacity) { this.capacity = capacity; this.idMap = new Map(); // Map for id and QCC @@ -97,14 +95,12 @@ QueryContextCache.prototype.merge = function (newQCE) { // Change in priority this.replaceQCE(qce, newQCE); } - } - else if (newQCE.timestamp === qce.timestamp && qce.priority !== newQCE.priority) { + } else if (newQCE.timestamp === qce.timestamp && qce.priority !== newQCE.priority) { // Same read timestamp but change in priority this.replaceQCE(qce, newQCE); } - } // id found - else { + } else { // new id if (this.priorityMap.has(newQCE.priority)) { @@ -223,12 +219,10 @@ QueryContextCache.prototype.deserializeQueryContextElement = function (node) { if(typeof context === 'string'){ entry.context = context; - } - else if (context === null || context === undefined) { + } else if (context === null || context === undefined) { entry.context = null; Logger.getInstance().debug('deserializeQueryContextElement `context` field is empty'); - } - else { + } else { Logger.getInstance().warn('deserializeQueryContextElement: `context` field is not String type'); return null; } @@ -238,11 +232,11 @@ QueryContextCache.prototype.deserializeQueryContextElement = function (node) { QueryContextCache.prototype.logCacheEntries = function () { - this.treeSet.forEach(function(elem) { - Logger.getInstance().debug( - `Cache Entry: id: ${elem.id} timestamp: ${elem.timestamp} priority: ${elem.priority}`, - ); - }); + this.treeSet.forEach(function(elem) { + Logger.getInstance().debug( + `Cache Entry: id: ${elem.id} timestamp: ${elem.timestamp} priority: ${elem.priority}`, + ); + }); }; QueryContextCache.prototype.getSize = function() {