Make BinarySearch() interface slightly more readable

Replace "equal" parameter with the (opposite) "lowerBound" one with a
more descriptive name, add a comment describing it and also remove the
default value to force explaining how it is used in the caller.

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-02-26 16:25:28 +01:00
parent 00fec01308
commit 6819b5512b
2 changed files with 8 additions and 6 deletions

View File

@@ -398,8 +398,10 @@ private:
// (if the old buffer is big enough, just return NULL).
wxString *Grow(size_t nIncrement);
// Binary search in the sorted array
size_t BinarySearch(const wxString& str, bool equal = false) const;
// Binary search in the sorted array: return the index of the string if it's
// present, otherwise, if lowerBound is true, return the position at which
// the string should be inserted and if it's false return wxNOT_FOUND.
size_t BinarySearch(const wxString& str, bool lowerBound) const;
size_t m_nSize, // current size of the array
m_nCount; // current number of elements