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:
Václav Slavík
2007-05-10 11:17:38 +00:00
parent 1545d942ec
commit 564ab31a53

View File

@@ -1047,15 +1047,14 @@ public:
wxUniChar Last() const
{
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
return at(length() - 1);
return *rbegin();
}
// get writable last character
wxUniCharRef Last()
{
wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") );
return at(length() - 1);
return *rbegin();
}
/*