Skip to content

Commit 66059f0

Browse files
committed
refactor(rename): this value name now typed
1 parent dd8a21b commit 66059f0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/optimization.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let localConfigPath: string | null = null;
6060
* Populated lazily on the first `getOptimizableFilterIds` call.
6161
* Shared across concurrent callers to avoid redundant percent.json fetches.
6262
*/
63-
let optimizableFilterIdsPromise: Set<number> | null = null;
63+
let optimizableFilterIds: Set<number> | null = null;
6464

6565
/**
6666
* Returns the set of optimizable filter IDs.
@@ -72,13 +72,13 @@ let optimizableFilterIdsPromise: Set<number> | null = null;
7272
* @returns Set of filter IDs that have optimization stats available.
7373
*/
7474
const getOptimizableFilterIds = async () => {
75-
if (optimizableFilterIdsPromise === null) {
75+
if (optimizableFilterIds === null) {
7676
const raw = localConfigPath !== null
7777
? await fs.readFile(path.join(localConfigPath, PERCENT_JSON), 'utf-8')
7878
: await downloadOptimizationPercent();
79-
optimizableFilterIdsPromise = new Set((JSON.parse(raw) as PercentJson).config.map(({ filterId: id }) => id));
79+
optimizableFilterIds = new Set((JSON.parse(raw) as PercentJson).config.map(({ filterId: id }) => id));
8080
}
81-
return optimizableFilterIdsPromise;
81+
return optimizableFilterIds;
8282
};
8383

8484
/**
@@ -195,9 +195,9 @@ export const getFilterOptimizationConfig = async (filterId: number) => {
195195
return null;
196196
}
197197

198-
const optimizableFilterIds = await getOptimizableFilterIds();
198+
const ids = await getOptimizableFilterIds();
199199

200-
if (!optimizableFilterIds.has(filterId)) {
200+
if (!ids.has(filterId)) {
201201
return null;
202202
}
203203

0 commit comments

Comments
 (0)