mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Refactor result comparison
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
94411d5465
commit
f73d87361a
@ -23,9 +23,8 @@ export class DetectorRegistry {
|
||||
const data = await detector.detect()
|
||||
if (!data) continue;
|
||||
const existingValue = results[detector.key]
|
||||
if ((existingValue && existingValue.accuracy < data.accuracy) || !existingValue) { // previous value exists and is less accurate
|
||||
results[detector.key] = data
|
||||
}
|
||||
if (existingValue && existingValue.accuracy > data.accuracy) continue; // previous value exists and is more accurate
|
||||
results[detector.key] = data
|
||||
} catch (e) {
|
||||
// detector raised error, do nothing
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user