Skip to content

Commit

Permalink
Removing unneeded ops from conditional statements
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Jan 13, 2019
1 parent b347c8e commit 785f03b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lib/tiny-lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @copyright 2019
* @license BSD-3-Clause
* @link https://github.com/avoidwork/tiny-lru
* @version 5.1.0
* @version 5.1.1
*/
"use strict";

Expand All @@ -29,7 +29,7 @@
}

delete (key, bypass = false) {
if (bypass === true || this.has(key) === true) {
if (bypass || this.has(key)) {
const item = this.cache[key];

delete this.cache[key];
Expand Down Expand Up @@ -66,7 +66,7 @@
get (key) {
let result;

if (this.has(key) === true) {
if (this.has(key)) {
const item = this.cache[key];

if (item.expiry === -1 || item.expiry > Date.now()) {
Expand All @@ -93,7 +93,7 @@
}

set (key, value, bypass = false) {
if (bypass === true || this.has(key) === true) {
if (bypass || this.has(key)) {
const item = this.cache[key];

item.value = value;
Expand Down
6 changes: 3 additions & 3 deletions lib/tiny-lru.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tiny-lru.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiny-lru",
"description": "Tiny LRU cache for Client or Server",
"version": "5.1.0",
"version": "5.1.1",
"homepage": "https://github.com/avoidwork/tiny-lru",
"author": "Jason Mulligan <jason.mulligan@avoidwork.com>",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/lru.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

delete (key, bypass = false) {
if (bypass === true || this.has(key) === true) {
if (bypass || this.has(key)) {
const item = this.cache[key];

delete this.cache[key];
Expand Down Expand Up @@ -52,7 +52,7 @@
get (key) {
let result;

if (this.has(key) === true) {
if (this.has(key)) {
const item = this.cache[key];

if (item.expiry === -1 || item.expiry > Date.now()) {
Expand All @@ -79,7 +79,7 @@
}

set (key, value, bypass = false) {
if (bypass === true || this.has(key) === true) {
if (bypass || this.has(key)) {
const item = this.cache[key];

item.value = value;
Expand Down

0 comments on commit 785f03b

Please sign in to comment.