Skip to content

Commit

Permalink
refactor: Cleanup #10348
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Dec 3, 2024
1 parent e37a322 commit c6ae873
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,19 +681,19 @@ export const makeRunPolicyProvider = () => {

/** @type {ReturnType<typeof computronCounter> | undefined} */
let policy;
let counting = false;
let policyEnabled = false;

const meter = harden({
provideRunPolicy: () => {
if (counting && !policy) {
if (policyEnabled && !policy) {
policy = computronCounter({ beansPerUnit });
}
return policy;
},
/** @param {boolean} x */
usePolicy: x => {
counting = x;
if (!counting) {
/** @param {boolean} forceEnabled */
usePolicy: forceEnabled => {
policyEnabled = forceEnabled;
if (!policyEnabled) {
policy = undefined;
}
},
Expand Down

0 comments on commit c6ae873

Please sign in to comment.