fixed wxString::Last() to run in O(1), not O(n), in UTF-8 build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1045,18 +1045,17 @@ public:
|
|||||||
|
|
||||||
// get last character
|
// get last character
|
||||||
wxUniChar Last() const
|
wxUniChar Last() const
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
|
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
|
||||||
|
return *rbegin();
|
||||||
return at(length() - 1);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// get writable last character
|
// get writable last character
|
||||||
wxUniCharRef Last()
|
wxUniCharRef Last()
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
|
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
|
||||||
return at(length() - 1);
|
return *rbegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Note that we we must define all of the overloads below to avoid
|
Note that we we must define all of the overloads below to avoid
|
||||||
|
Reference in New Issue
Block a user