Skip to content

Commit

Permalink
fix #9424
Browse files Browse the repository at this point in the history
remove unused code
  • Loading branch information
sokra committed Jul 17, 2019
1 parent 95d21bb commit 1f966eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ResolverFactory.js
Expand Up @@ -10,6 +10,8 @@ const { cachedCleverMerge } = require("./util/cleverMerge");

/** @typedef {import("enhanced-resolve").Resolver} Resolver */

const EMTPY_RESOLVE_OPTIONS = {};

module.exports = class ResolverFactory extends Tapable {
constructor() {
super();
Expand Down Expand Up @@ -40,13 +42,11 @@ module.exports = class ResolverFactory extends Tapable {
return true;
}
});
this.cache1 = new WeakMap();
this.cache2 = new Map();
}

get(type, resolveOptions) {
const cachedResolver = this.cache1.get(resolveOptions);
if (cachedResolver) return cachedResolver();
resolveOptions = resolveOptions || EMTPY_RESOLVE_OPTIONS;
const ident = `${type}|${JSON.stringify(resolveOptions)}`;
const resolver = this.cache2.get(ident);
if (resolver) return resolver;
Expand Down

0 comments on commit 1f966eb

Please sign in to comment.