Skip to content

Commit

Permalink
feat(block): check at index only in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandini committed May 29, 2024
1 parent 9e0ec58 commit 0012153
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Matrix/pzblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ int64_t TPZBlock::Index(const int64_t bRow, const int r) const
{
auto MaxBlocks = fBlock.NElements();
int64_t row(r);
#ifdef PZDEBUG
if(bRow <0 || bRow >= MaxBlocks || row < 0 || row >= fBlock[bRow].dim) {
PZError << __PRETTY_FUNCTION__ <<" indexes out of range\n";
DebugStop();
}
#endif
row += fBlock[bRow].pos;
return row;
}
Expand Down

0 comments on commit 0012153

Please sign in to comment.