Skip to content

Commit

Permalink
Revert "simplified iterator/index arithmetics using static casts. re g…
Browse files Browse the repository at this point in the history
…entryx#49"

This reverts commit 627a545.
  • Loading branch information
seb-ehm committed Nov 5, 2017
1 parent 627a545 commit a04a6f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libgeodecomp/storage/reorderingunstructuredgrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ class ReorderingUnstructuredGrid : public GridBase<typename DELEGATE_GRID::CellT
}

for (RowLengthVec::iterator i = reorderedRowLengths.begin(); i != reorderedRowLengths.end(); ) {
RowLengthVec::iterator nextStop = static_cast<RowLengthVec::iterator>((std::min)(static_cast<RowLengthVec::size_type>(i) + SIGMA, reorderedRowLengths.end()));
std::size_t currentIndex = i - reorderedRowLengths.begin();
std::size_t nextIndex = (std::min)(currentIndex + SIGMA, reorderedRowLengths.size());
RowLengthVec::iterator nextStop = reorderedRowLengths.begin() + currentIndex;

std::stable_sort(i, nextStop, [](const IntPair& a, const IntPair& b) {
return a.second > b.second;
Expand Down

0 comments on commit a04a6f7

Please sign in to comment.