From 0b04b130f90c4832f2f761f1ad503722c7f373df Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Mon, 6 Aug 2018 12:30:00 -0230 Subject: [PATCH] Minor optimization: use two-way IF instead of separate ones. --- src/unix/FSNodePOSIX.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/unix/FSNodePOSIX.cxx b/src/unix/FSNodePOSIX.cxx index 7a68dcad5..1931139de 100644 --- a/src/unix/FSNodePOSIX.cxx +++ b/src/unix/FSNodePOSIX.cxx @@ -59,12 +59,11 @@ FilesystemNodePOSIX::FilesystemNodePOSIX(const string& p, bool verify) if(_path[0] == '~') { const char* home = getenv("HOME"); - if (home != nullptr) + if(home != nullptr) _path.replace(0, 1, home); } - // Get absolute path (only used for relative directories) - if(_path[0] == '.') + else if(_path[0] == '.') { char buf[MAXPATHLEN]; if(realpath(_path.c_str(), buf))