Just return true from wxString::Shrink()
The comparison of lengths() seems to be completely unnecessary. Also document that Shrink() always returns true.
This commit is contained in:
@@ -1428,8 +1428,12 @@ public:
|
|||||||
bool Alloc(size_t nLen);
|
bool Alloc(size_t nLen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Minimizes the string's memory. This can be useful after a call to
|
Minimizes the string's memory.
|
||||||
Alloc() if too much memory were preallocated.
|
|
||||||
|
This can be useful after a call to Alloc() if too much memory were
|
||||||
|
preallocated.
|
||||||
|
|
||||||
|
@return Always returns @true
|
||||||
*/
|
*/
|
||||||
bool Shrink();
|
bool Shrink();
|
||||||
|
|
||||||
|
@@ -555,7 +555,7 @@ bool wxString::Shrink()
|
|||||||
{
|
{
|
||||||
wxString tmp(begin(), end());
|
wxString tmp(begin(), end());
|
||||||
swap(tmp);
|
swap(tmp);
|
||||||
return tmp.length() == length();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecated compatibility code:
|
// deprecated compatibility code:
|
||||||
|
Reference in New Issue
Block a user