Skip to content

Commit

Permalink
Ensure we don't try to build an InfoReqest without args
Browse files Browse the repository at this point in the history
Fixes #107.
  • Loading branch information
falconindy committed Sep 12, 2024
1 parent 5ed4438 commit f4cebb5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/auracle/auracle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,14 @@ void Auracle::ResolveMany(const std::vector<std::string>& depstrings,

void Auracle::IteratePackages(std::vector<std::string> args,
Auracle::PackageIterator* state) {
aur::InfoRequest info_request;

for (const auto& arg : args) {
if (state->package_cache.LookupByPkgname(arg) != nullptr) {
continue;
}

info_request.AddArg(arg);
std::erase_if(args, [&](const std::string& arg) {
return state->package_cache.LookupByPkgname(arg) != nullptr;
});
if (args.empty()) {
return;
}

aur::InfoRequest info_request(args);
client_->QueueRpcRequest(
info_request, [this, state, want = std::move(args)](
absl::StatusOr<aur::RpcResponse> response) {
Expand Down

0 comments on commit f4cebb5

Please sign in to comment.