Skip to content

Commit

Permalink
Fix warnings and co (#3507)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M authored Oct 4, 2024
1 parent 675c6de commit 80c8b18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libmamba/src/specs/match_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,11 @@ namespace mamba::specs
// TODO: this solution reallocates memory several times potentially, but the
// number of operators is small and the strings are short, so it must be fine.
// If needed it can be optimized so that the string is only copied once.
for (const std::string& op : { ">=", "<=", "==", ">", "<", "!=", "=", "==", "~=", "," })
const auto op_array = std::array<std::string, 9>{ ">=", "<=", ">", "<", "!=",
"=", "==", "~=", "," };
for (const std::string& op : op_array)
{
const std::string& bad_op = op + " ";
const std::string bad_op = op + " ";
while (raw_match_spec_str.find(bad_op) != std::string::npos)
{
raw_match_spec_str = raw_match_spec_str.substr(0, raw_match_spec_str.find(bad_op)) + op
Expand Down Expand Up @@ -604,7 +606,7 @@ namespace mamba::specs
{
if (is_hash(hash))
{
ms.set_md5(std::string(hash));
ms.set_md5(hash);
}
return ms;
}
Expand Down

0 comments on commit 80c8b18

Please sign in to comment.