refactor: simplify loop using slices.Contains (#2451)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-03-22 02:15:38 +01:00
1 parent f63d1b599c
commit 5a15e4c4ca
1 file changed
+3 -6
+3 -6
View File
@@ -474,12 +474,9 @@ func (app *app) loop() {
deletePathRecursive(app.nav.regCache, path)
deletePathRecursive(app.nav.dirCache, path)
for _, dirPath := range app.nav.dirPaths {
if dirPath == path {
if err := app.nav.cd(filepath.Dir(path)); err != nil {
log.Print(err)
}
break
if slices.Contains(app.nav.dirPaths, path) {
if err := app.nav.cd(filepath.Dir(path)); err != nil {
log.Print(err)
}
}
case ev := <-app.ui.evChan: