File: upstream_d5f2db39_windowswalker-don-t-else-after-return.patch

package info (click to toggle)
filelight 4%3A25.04.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,568 kB
  • sloc: cpp: 2,775; xml: 480; makefile: 10; sh: 3
file content (38 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From d5f2db39e673f3fde80311a0bb26ae08c02b0074 Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Fri, 18 Apr 2025 15:50:18 +0200
Subject: [PATCH] windowswalker: don't else after return

makes things easier to read
---
 src/windowsWalker.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/windowsWalker.cpp b/src/windowsWalker.cpp
index b2a79e7f..539c2264 100644
--- a/src/windowsWalker.cpp
+++ b/src/windowsWalker.cpp
@@ -53,15 +53,14 @@ void WindowsWalker::next()
                 // qDebug() << "no more files";
                 close();
                 return;
-            } else {
-                qWarning() << m_path << ':' << errorCode << GetLastErrorAsString(errorCode);
             }
             // WARNING: do not access m_fileinfo, it has undefined content!
+            qWarning() << m_path << ':' << errorCode << GetLastErrorAsString(errorCode);
+            continue;
+        }
+
+        if (m_fileinfo.cFileName == std::wstring(L".") || m_fileinfo.cFileName == std::wstring(L"..")) {
             continue;
-        } else {
-            if (m_fileinfo.cFileName == std::wstring(L".") || m_fileinfo.cFileName == std::wstring(L"..")) {
-                continue;
-            }
         }
 
         updateEntry();
-- 
GitLab