Skip to content

Commit 0af77f3

Browse files
committed
Fix duplicate path handling in getFallbackPaths function
1 parent 128eb98 commit 0af77f3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/services/realtimeengine/iacrealtime/iac-realtime.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ func getFallbackPaths(engineName, fallBackDir string) []string {
195195

196196
for _, dir := range additionalPaths {
197197
enginePath := filepath.Join(dir, engineName)
198-
// Avoid duplicates
199-
if enginePath != filepath.Join(fallBackDir, engineName) {
200-
paths = append(paths, enginePath)
198+
// Skip duplicates
199+
if enginePath == filepath.Join(fallBackDir, engineName) {
200+
continue
201201
}
202+
paths = append(paths, enginePath)
202203
}
203204

204205
// Add user home-based paths

0 commit comments

Comments
 (0)