String::upper() no longer modifies the String itself

This commit is contained in:
Tsuda Kageyu 2013-10-30 19:37:44 +09:00
parent 57d12de7dd
commit ced5f262ba

View File

@ -390,7 +390,7 @@ String String::upper() const
{
static const int shift = 'A' - 'a';
String s(*this);
String s(*d->data);
for(Iterator it = s.begin(); it != s.end(); ++it) {
if(*it >= 'a' && *it <= 'z')
*it = *it + shift;