Skip to content

Commit

Permalink
Report just once
Browse files Browse the repository at this point in the history
  • Loading branch information
hejny committed Mar 29, 2024
1 parent 91518c9 commit 030d66d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/SolutionRank.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,20 @@ export class SolutionRank {
}

calculate() {
if (this._preferencesToBeRanked.size > 0) {
if (this._preferencesToBeRanked.size > 0 && !reportedCalculateWarningFor.has(this.title)) {
console.warn(
`For ${this.title} there are ${this._preferencesToBeRanked.size} preferences not ranked: ${Array.from(
this._preferencesToBeRanked,
).join(', ')}`,
);
reportedCalculateWarningFor.add(this.title);
}

return this;
}
}

/**
* @singleton
*/
let reportedCalculateWarningFor = new Set();

0 comments on commit 030d66d

Please sign in to comment.