Add force setting to MinCovered
This commit is contained in:
parent
dc124ace20
commit
0abd50ac0c
2 changed files with 21 additions and 4 deletions
|
|
@ -18,6 +18,15 @@ export class CoveredValues {
|
|||
|
||||
public constructor(private minValue: number) {}
|
||||
|
||||
public get min(): number {
|
||||
return this.minValue;
|
||||
}
|
||||
|
||||
public set min(value: number) {
|
||||
this.minValue = Math.max(value, this.minValue);
|
||||
this.seenValues = this.seenValues.filter((v) => v > value);
|
||||
}
|
||||
|
||||
public add(value: number): void {
|
||||
if (value < this.minValue) {
|
||||
return;
|
||||
|
|
@ -44,8 +53,4 @@ export class CoveredValues {
|
|||
this.minValue++;
|
||||
}
|
||||
}
|
||||
|
||||
public get min(): number {
|
||||
return this.minValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue