From ef5747c20a46dbbb70eba98b8e4a376bc866b80c Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Mon, 27 Aug 2018 12:47:37 +0200 Subject: [PATCH] clang-tidy -checks=-*,performance-faster-string --- .clang-tidy | 2 +- src/core/config/Config.cpp | 6 +++--- src/core/config/Create.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index e92ef5137..f56e5b4e9 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: '-*,bugprone-*,modernize-*,-modernize-use-auto,-modernize-loop-convert,-modernize-pass-by-value,-modernize-raw-string-literal,-modernize-use-using,-modernize-avoid-bind,-modernize-return-braced-init-list,-modernize-use-transparent-functors,-modernize-redundant-void-arg' +Checks: '-*,bugprone-*,misc-string-compare,modernize-*,performance-faster-string-find,-modernize-use-auto,-modernize-loop-convert,-modernize-pass-by-value,-modernize-raw-string-literal,-modernize-use-using,-modernize-avoid-bind,-modernize-return-braced-init-list,-modernize-use-transparent-functors,-modernize-redundant-void-arg' WarningsAsErrors: '*' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false diff --git a/src/core/config/Config.cpp b/src/core/config/Config.cpp index 54c147b00..33bae7dc3 100644 --- a/src/core/config/Config.cpp +++ b/src/core/config/Config.cpp @@ -273,7 +273,7 @@ void Config::parseFromFile( const char* filename, Block& block, unsigned int lev { input.ignore( 1 ); while( (value.find("$(") != value.npos) && (value.find(')') != value.npos) ) { - size_t s = value.find("$("); size_t e = value.find(")"); + 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 ); @@ -315,7 +315,7 @@ void Config::parseFromString( const std::string & str, Block& block, unsigned in while (!input.empty()) { std::string::size_type f=input.find_first_of(" {"); if (input[f]==' ') { - std::string::size_type posSemicolon = input.substr(f+1).find(";"); + std::string::size_type posSemicolon = input.substr(f+1).find(';'); block.addParameter(input.substr(0,f),input.substr(f+1,posSemicolon)); input = input.substr(f+1+posSemicolon+1); } else { @@ -406,7 +406,7 @@ void Config::extractBlock( const char* filename, std::stringstream& input, Block { input.ignore( 1 ); while( (value.find("$(") != value.npos) && (value.find(')') != value.npos) ) { - size_t s = value.find("$("); size_t e = value.find(")"); + 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 ); diff --git a/src/core/config/Create.cpp b/src/core/config/Create.cpp index 7e945cfd8..8e90173e7 100644 --- a/src/core/config/Create.cpp +++ b/src/core/config/Create.cpp @@ -261,7 +261,7 @@ namespace config { throw std::runtime_error( usageString(argv[0]) ); - auto dotPosition = filename.find_last_of("."); + auto dotPosition = filename.find_last_of('.'); int numberOfZeros=0; if ( dotPosition != std::string::npos ) -- GitLab