Skip to content

Commit 32a204b

Browse files
committed
Reorder to keep unsigned computation positive
1 parent f95be14 commit 32a204b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/numerics/petsc_vector.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ void PetscVector<T>::localize (const numeric_index_type first_local_idx,
743743
libmesh_assert_less_equal (last_local_idx+1, this->size());
744744

745745
const numeric_index_type my_size = this->size();
746-
const numeric_index_type my_local_size = (last_local_idx - first_local_idx + 1);
746+
const numeric_index_type my_local_size = (last_local_idx + 1 - first_local_idx);
747747
PetscErrorCode ierr=0;
748748

749749
// Don't bother for serial cases

0 commit comments

Comments
 (0)