From b79da51486a9d7e62efef9259171785565d731a4 Mon Sep 17 00:00:00 2001 From: andriish Date: Thu, 9 Jan 2025 04:51:07 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Andre Sailer --- GaudiPluginService/src/PluginServiceV1.cpp | 2 +- GaudiPluginService/src/PluginServiceV2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GaudiPluginService/src/PluginServiceV1.cpp b/GaudiPluginService/src/PluginServiceV1.cpp index c814730d3..58d89cb56 100644 --- a/GaudiPluginService/src/PluginServiceV1.cpp +++ b/GaudiPluginService/src/PluginServiceV1.cpp @@ -159,7 +159,7 @@ namespace Gaudi { if ( true ) { logger().debug( std::string( "searching factories in " ) + envVar ); std::string path; - if ( search_path ) path = std::string(search_path); else path="/usr/lib64:/usr/lib:/usr/local/lib"; + path = search_path ? std::string(search_path) : "/usr/lib64:/usr/lib:/usr/local/lib"; std::string::size_type pos = 0; std::string::size_type newpos = 0; while ( pos != std::string::npos ) { diff --git a/GaudiPluginService/src/PluginServiceV2.cpp b/GaudiPluginService/src/PluginServiceV2.cpp index 06da671ec..4afd1187d 100644 --- a/GaudiPluginService/src/PluginServiceV2.cpp +++ b/GaudiPluginService/src/PluginServiceV2.cpp @@ -158,7 +158,7 @@ namespace Gaudi { std::string search_path; const char* envPtr = std::getenv( envVar.c_str() ); - if ( envPtr ) search_path = envPtr; else search_path="/usr/lib64:/usr/lib:/usr/local/lib"; + search_path = envPtr ? envPtr : "/usr/lib64:/usr/lib:/usr/local/lib"; if ( search_path.empty() ) { return; }