mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 13:15:04 -06:00
9.18
This commit is contained in:
committed by
Kornel Lesiński
parent
2eb60a0598
commit
c65230d858
@@ -78,6 +78,22 @@ public:
|
||||
operator[](j) = temp;
|
||||
}
|
||||
|
||||
int FindInSorted(const T& item, int left, int right) const
|
||||
{
|
||||
while (left != right)
|
||||
{
|
||||
int mid = (left + right) / 2;
|
||||
const T& midValue = (*this)[mid];
|
||||
if (item == midValue)
|
||||
return mid;
|
||||
if (item < midValue)
|
||||
right = mid;
|
||||
else
|
||||
left = mid + 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int FindInSorted(const T& item) const
|
||||
{
|
||||
int left = 0, right = Size();
|
||||
|
||||
Reference in New Issue
Block a user