Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 23dcc6a

Browse files
author
Andreas Richter
committed
chore: feedback addressed
1 parent 29b26fa commit 23dcc6a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/backends/memcached.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
const promisify = require('bluebird').promisify;
3636
const Memcached = require('memcached');
3737

38+
const noop = () => undefined;
39+
3840
function createClient(options) {
3941
if (options.client) {
4042
return options.client;
@@ -62,11 +64,12 @@ MemcachedBackend.prototype.get = function get(key) {
6264
};
6365

6466
MemcachedBackend.prototype.set = function set(key, value, options) {
65-
return this._clientSet(key, value, options.expire).then(val => val);
67+
const constant = () => value;
68+
return this._clientSet(key, value, options.expire).then(constant);
6669
};
6770

6871
MemcachedBackend.prototype.unset = function unset(key) {
69-
return this._clientDel(key).then(() => undefined);
72+
return this._clientDel(key).then(noop);
7073
};
7174

7275
MemcachedBackend.prototype.end = function end() {

0 commit comments

Comments
 (0)