Skip to content

Commit

Permalink
Apply review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>

Co-authored-by: Johan Mabille <[email protected]>
  • Loading branch information
jjerphan and JohanMabille committed Oct 2, 2024
1 parent 5067faf commit 8e0da9e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions libmamba/src/core/history.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,7 @@ namespace mamba
// Capturing `MatchSpecs` without internal quotes (e.g `libcurl`)
if (idx_end != std::string::npos && value[idx_end - 1] != '\\')
{
auto start_string = idx_start + 1;
auto len_matchspec = idx_end - start_string;

// Quotes are excluded (e.g. `libcurl` is extracted from `"libcurl"`)
auto match_spec = value.substr(start_string, len_matchspec);
pkg_specs.push_back(match_spec);
pkg_specs.push_back(value.substr(idx_start + 1, idx_end - 1 - idx_start));
idx_start = value.find_first_of("\'\"", idx_end + 1);
idx_search = idx_start + 1;
}
Expand Down Expand Up @@ -163,7 +158,7 @@ namespace mamba
std::remove(match_spec.begin(), match_spec.end(), '\\'),
match_spec.end()
);
pkg_specs.push_back(match_spec);
pkg_specs.push_back(std::move(match_spec));
idx_start = value.find_first_of("\'\"", end_string + 1);
idx_search = idx_start + 1;
}
Expand Down

0 comments on commit 8e0da9e

Please sign in to comment.