From b955736bcae805cf6655b6aeca0f63b58a737431 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi Date: Mon, 12 Feb 2024 16:17:49 +0100 Subject: [PATCH] Fix cppecheck --- src/tools/Keywords.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/Keywords.cpp b/src/tools/Keywords.cpp index 9daa2efd7d..778765d4d1 100644 --- a/src/tools/Keywords.cpp +++ b/src/tools/Keywords.cpp @@ -202,7 +202,7 @@ void Keywords::add( const std::string & t, const std::string & k, const std::str void Keywords::addFlag( const std::string & k, const bool def, const std::string & d ) { plumed_massert( !exists(k) && !reserved(k), "keyword " + k + " has already been registered"); std::string defstr; plumed_massert( !def, "the second argument to addFlag must be false " + k ); - if( def ) { defstr="( default=on ) "; } else { defstr="( default=off ) "; } + defstr="( default=off ) "; types.insert( std::pair(k,KeyType("flag")) ); documentation.insert( std::pair(k,defstr + d) ); allowmultiple.insert( std::pair(k,false) );