Don't pretend to fall off the end of Nodes::useSocks5Proxy()
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Tue, 17 Jun 2025 16:22:32 +0000 (18:22 +0200)
committerнаб <nabijaczleweli@nabijaczleweli.xyz>
Tue, 17 Jun 2025 16:39:50 +0000 (18:39 +0200)
[334/404] Building CXX object src/CMakeFiles/feather.dir/utils/nodes.cpp.o
/home/nabijaczleweli/uwu/feather/src/utils/nodes.cpp:503:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
  503 | }
      | ^
1 warning generated.

src/utils/nodes.cpp

index f924ea6a1f8b895d49942b86423f31b48818a14b..d9702f2dae00a21b3a8e9943b155f6a9b8357ec1 100644 (file)
@@ -479,7 +479,8 @@ bool Nodes::useSocks5Proxy(const FeatherNode &node) {
         return false;
     }
 
-    if (conf()->get(Config::proxy).toInt() == Config::Proxy::None) {
+    const auto config_proxy = conf()->get(Config::proxy).toInt();
+    if (config_proxy == Config::Proxy::None) {
         return false;
     }
 
@@ -492,14 +493,12 @@ bool Nodes::useSocks5Proxy(const FeatherNode &node) {
         return true;
     }
 
-    if (conf()->get(Config::proxy).toInt() == Config::Proxy::Tor) {
+    if (config_proxy == Config::Proxy::Tor) {
         // Don't use socks5 proxy if initial sync traffic is excluded.
         return this->useOnionNodes();
     }
 
-    if (conf()->get(Config::proxy).toInt() != Config::Proxy::None) {
-        return true;
-    }
+    return true;
 }
 
 void Nodes::updateModels() {