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:
@@ -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
|
||||
|
Reference in New Issue
Block a user