Skip to content

Commit ba13753

Browse files
committed
minor source code refactoring
1 parent cce5f25 commit ba13753

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/router/sequential.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module.exports = (config = {}) => {
2525
}
2626

2727
const routers = {}
28-
const hasCache = config.cacheSize > 0
29-
const cache = hasCache ? new LRU(config.cacheSize) : null
28+
const isCacheEnabled = config.cacheSize > 0
29+
const cache = isCacheEnabled ? new LRU(config.cacheSize) : null
3030
const router = new Trouter()
3131
router.id = config.id
3232

@@ -59,7 +59,7 @@ module.exports = (config = {}) => {
5959
queryparams(req, req.url)
6060

6161
let match
62-
if (hasCache) {
62+
if (isCacheEnabled) {
6363
const reqCacheKey = req.method + req.path
6464
match = cache.get(reqCacheKey)
6565
if (!match) {

0 commit comments

Comments
 (0)