From 240ef8af39ee7e634c53383a9f6f063791c19498 Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Wed, 28 Aug 2019 12:43:11 +0200 Subject: [PATCH] [CLANG-TIDY] readability-static-accessed-through-instance --- .clang-tidy | 3 ++- src/core/config/Config.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 9ac2c70c5..ec8ca4c8a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -39,7 +39,8 @@ readability-deleted-default, readability-misleading-indentation, readability-misplaced-array-index, readability-redundant-control-flow, -readability-redundant-smartptr-get +readability-redundant-smartptr-get, +readability-static-accessed-through-instance ' WarningsAsErrors: '*' diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index e136e64ec..dfd7a6834 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -271,16 +271,16 @@ void Config::parseFromFile( const char* filename, Block& block, unsigned int lev else if( std::getline( input, value, ';' ) && !input.eof() ) { input.ignore( 1 ); - while( (value.find("$(") != value.npos) && (value.find(')') != value.npos) ) { + while( (value.find("$(") != std::string::npos) && (value.find(')') != std::string::npos) ) { size_t s = value.find("$("); size_t e = value.find(')'); ValueReplacementMap::iterator mkey = valueReplacements_.find( value.substr( s+2, e-s+1-3 ) ); if(mkey != valueReplacements_.end()) { value.replace( s,e-s+1, mkey->second ); } else { - if(e!=value.npos) + if(e!=std::string::npos) value.erase(e,1); - if(s!=value.npos) + if(s!=std::string::npos) value.erase(s,2); } } @@ -404,16 +404,16 @@ void Config::extractBlock( const char* filename, std::stringstream& input, Block else if( std::getline( input, value, ';' ) && !input.eof() ) { input.ignore( 1 ); - while( (value.find("$(") != value.npos) && (value.find(')') != value.npos) ) { + while( (value.find("$(") != std::string::npos) && (value.find(')') != std::string::npos) ) { size_t s = value.find("$("); size_t e = value.find(')'); ValueReplacementMap::iterator mkey = valueReplacements_.find( value.substr( s+2, e-s+1-3 ) ); if(mkey != valueReplacements_.end()) { value.replace( s,e-s+1, mkey->second ); } else { - if(e!=value.npos) + if(e!=std::string::npos) value.erase(e,1); - if(s!=value.npos) + if(s!=std::string::npos) value.erase(s,2); } } -- GitLab