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:
Vadim Zeitlin
2019-08-22 00:04:04 +02:00
parent ea965327eb
commit 70f8bf4c86
2 changed files with 7 additions and 3 deletions

View File

@@ -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();

View File

@@ -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: