mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-07-07 04:53:03 -05:00
Merge pull request #5420 from atgeirr/avoid-uninitialized-variable
Ensure 'mid' is always initialized.
This commit is contained in:
commit
fcad25e26a
|
@ -286,10 +286,9 @@ namespace
|
|||
// we binary search over
|
||||
int left = rowIndices[col];
|
||||
int right = rowIndices[col + 1] - 1;
|
||||
int mid;
|
||||
int mid = left + (right - left) / 2; // overflow-safe average;
|
||||
|
||||
while (left <= right) {
|
||||
mid = left + (right - left) / 2; // overflow-safe average
|
||||
const int col = colIndices[mid];
|
||||
|
||||
if (col == naturalRowIdx) {
|
||||
|
@ -299,6 +298,7 @@ namespace
|
|||
} else {
|
||||
right = mid - 1;
|
||||
}
|
||||
mid = left + (right - left) / 2; // overflow-safe average
|
||||
}
|
||||
|
||||
const int symOpposite = mid;
|
||||
|
|
Loading…
Reference in New Issue
Block a user