Skip to content

Commit

Permalink
Per #3087, back out the ConcatString changes to switch from enum to e…
Browse files Browse the repository at this point in the history
…num class and the use of explicit since those had huge and wide-ranging impacts. Touching that many files is not worth it to reduce SonarQube code smells.
  • Loading branch information
JohnHalleyGotway committed Feb 19, 2025
1 parent 8d92478 commit c682866
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/basic/vx_log/concat_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,8 @@ ConcatString & operator<<(ConcatString & a, CSInlineCommand c)

switch ( c ) {

case CSInlineCommand::cs_erase: a.erase(); break;
case CSInlineCommand::cs_clear: a.clear(); break;
case cs_erase: a.erase(); break;
case cs_clear: a.clear(); break;

default:
mlog << Error << "\noperator<<(ostream &, CSInlineCommand) -> "
Expand Down Expand Up @@ -1228,7 +1228,7 @@ int ConcatString::find(int c) const
////////////////////////////////////////////////////////////////////////


int ConcatString::compare(size_t pos, size_t len, std::string &str) const
int ConcatString::compare(size_t pos, size_t len, const std::string &str) const

{
return s.compare(pos, len, str);
Expand All @@ -1238,7 +1238,7 @@ int ConcatString::compare(size_t pos, size_t len, std::string &str) const
////////////////////////////////////////////////////////////////////////


int ConcatString::comparecase(size_t pos, size_t len, std::string &str) const
int ConcatString::comparecase(size_t pos, size_t len, const std::string &str) const

{
std::string lower_s = s;
Expand Down
10 changes: 5 additions & 5 deletions src/basic/vx_log/concat_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static const int concat_string_max_precision = 12;
////////////////////////////////////////////////////////////////////////


enum class CSInlineCommand {
enum CSInlineCommand {

cs_erase,
cs_clear
Expand Down Expand Up @@ -69,8 +69,8 @@ class ConcatString {
ConcatString();
~ConcatString();
ConcatString(const ConcatString &);
explicit ConcatString(const std::string &);
explicit ConcatString(const char *);
ConcatString(const std::string &);
ConcatString(const char *);
ConcatString & operator=(const ConcatString &);
ConcatString & operator=(const std::string &);
ConcatString & operator=(const char *);
Expand Down Expand Up @@ -169,8 +169,8 @@ class ConcatString {
void set_lower();

int find(int c) const;
int compare(size_t pos, size_t len, std::string &str) const;
int comparecase(size_t pos, size_t len, std::string &str) const;
int compare(size_t pos, size_t len, const std::string &str) const;
int comparecase(size_t pos, size_t len, const std::string &str) const;
int comparecase(const char *) const;

};
Expand Down

0 comments on commit c682866

Please sign in to comment.