Fix bug in deduplicate
This commit is contained in:
parent
fbcd74312f
commit
0ca2be0e51
@ -63,7 +63,7 @@ function isDefined<X>(value: X | undefined): value is X {
|
||||
function deduplicate<T>(input: ReadonlyArray<T>, comparator: (a: T, b: T) => number): Array<T> {
|
||||
const out = new Array<T>();
|
||||
for (const element of input) {
|
||||
if (!out.find((o) => comparator(o, element) === 0)) {
|
||||
if (out.find((o) => comparator(o, element) === 0) === undefined) {
|
||||
out.push(element);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user