Use an in-place if.
authorCarl Hetherington <cth@carlh.net>
Sat, 14 Dec 2024 23:25:16 +0000 (00:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 14 Dec 2024 23:25:16 +0000 (00:25 +0100)
src/lib/util.cc

index 105f109a368a90b58498221b75dd4283a33271c9..c13d292fd8c524def9a9704d843f1bedb3373bcb 100644 (file)
@@ -1134,8 +1134,7 @@ setup_grok_library_path()
 {
        static std::string old_path;
        if (old_path.empty()) {
-               auto const old = getenv("LD_LIBRARY_PATH");
-               if (old) {
+               if (auto const old = getenv("LD_LIBRARY_PATH")) {
                        old_path = old;
                }
        }