Skip to content

Commit

Permalink
Merge branch 'hotfix/1.10.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
danovaro committed Oct 11, 2023
2 parents ef6ba29 + 79d5aff commit b7a1440
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.15
1.10.16
6 changes: 3 additions & 3 deletions src/metkit/hypercube/HyperCube.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ std::vector<std::pair<metkit::mars::MarsRequest, size_t>> HyperCube::request(std
return requests;
}

std::vector<metkit::mars::MarsRequest> HyperCube::vacantRequests() const {
std::vector<metkit::mars::MarsRequest> HyperCube::aggregatedRequests(bool remaining) const {

if (countVacant() == 0)
if (countVacant() == (remaining ? 0 : size()))
return std::vector<metkit::mars::MarsRequest>{};

std::set<size_t> idxs;
for(size_t i = 0; i < set_.size(); ++i) {
if (set_[i])
if (set_[i] == remaining)
idxs.emplace(i);
}

Expand Down
4 changes: 3 additions & 1 deletion src/metkit/hypercube/HyperCube.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ class HyperCube {
size_t size() const {return cube_.count(); }

size_t fieldOrdinal(const metkit::mars::MarsRequest&, bool noholes = true) const;
std::vector<metkit::mars::MarsRequest> vacantRequests() const;
std::vector<metkit::mars::MarsRequest> vacantRequests() const { return aggregatedRequests(true); }
std::vector<metkit::mars::MarsRequest> requests() const { return aggregatedRequests(false); }

protected:
std::vector<metkit::mars::MarsRequest> aggregatedRequests(bool remaining) const;
int indexOf(const metkit::mars::MarsRequest&) const;
bool clear(int index);
metkit::mars::MarsRequest requestOf(size_t index) const;
Expand Down

0 comments on commit b7a1440

Please sign in to comment.