From 35fc57291f53ef7134be90a5482b9c11386868eb Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Tue, 21 Feb 2023 11:48:56 +0200 Subject: [PATCH] Deduplicate WSL driverstore paths Signed-off-by: Evan Lezar --- internal/dxcore/api.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/dxcore/api.go b/internal/dxcore/api.go index 4408c29a..fd63d5a6 100644 --- a/internal/dxcore/api.go +++ b/internal/dxcore/api.go @@ -49,9 +49,15 @@ func Shutdown() error { // GetDriverStorePaths returns the list of driver store paths func GetDriverStorePaths() []string { var paths []string + selected := make(map[string]bool) + for i := 0; i < dxcore.getAdapterCount(); i++ { - adapter := dxcore.getAdapter(i) - paths = append(paths, adapter.getDriverStorePath()) + path := dxcore.getAdapter(i).getDriverStorePath() + if selected[path] { + continue + } + selected[path] = true + paths = append(paths, path) } return paths