mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Ensure 'mid' is always initialized.
This commit is contained in:
parent
302503e172
commit
71684bfe2c
@ -286,10 +286,9 @@ namespace
|
|||||||
// we binary search over
|
// we binary search over
|
||||||
int left = rowIndices[col];
|
int left = rowIndices[col];
|
||||||
int right = rowIndices[col + 1] - 1;
|
int right = rowIndices[col + 1] - 1;
|
||||||
int mid;
|
int mid = left + (right - left) / 2; // overflow-safe average;
|
||||||
|
|
||||||
while (left <= right) {
|
while (left <= right) {
|
||||||
mid = left + (right - left) / 2; // overflow-safe average
|
|
||||||
const int col = colIndices[mid];
|
const int col = colIndices[mid];
|
||||||
|
|
||||||
if (col == naturalRowIdx) {
|
if (col == naturalRowIdx) {
|
||||||
@ -299,6 +298,7 @@ namespace
|
|||||||
} else {
|
} else {
|
||||||
right = mid - 1;
|
right = mid - 1;
|
||||||
}
|
}
|
||||||
|
mid = left + (right - left) / 2; // overflow-safe average
|
||||||
}
|
}
|
||||||
|
|
||||||
const int symOpposite = mid;
|
const int symOpposite = mid;
|
||||||
|
Loading…
Reference in New Issue
Block a user