Skip to content

Commit

Permalink
removed comments and spaces and ran lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Sep 22, 2023
1 parent 9903f0c commit f3c2d40
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions lib/queryContextCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}
Expand All @@ -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() {
Expand Down

0 comments on commit f3c2d40

Please sign in to comment.