From ff12bcd4fb9ca31b3366c2eb7343ee462550f0f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 4 Dec 2025 14:00:28 +0100 Subject: [PATCH] path: simplify run() No functional change, just less indents. --- src/path/path-tool.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/path/path-tool.c b/src/path/path-tool.c index 227468dfe8f..62eade3b05d 100644 --- a/src/path/path-tool.c +++ b/src/path/path-tool.c @@ -250,13 +250,11 @@ static int run(int argc, char* argv[]) { if (r <= 0) return r; - if (argc > optind) { - r = 0; - for (int i = optind; i < argc; i++) - RET_GATHER(r, print_path(argv[i])); - } else - r = list_paths(); + if (optind >= argc) + return list_paths(); + for (int i = optind; i < argc; i++) + RET_GATHER(r, print_path(argv[i])); return r; } -- 2.47.3