X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a603a10e77f719458939d117e46f7d8ed0b372b..3c06bd88f48859dfd3f3948ffcfdcb0b9248ccd8:/src/html/m_pre.cpp diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index b2a5cb89e5..c4a33f8c82 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -33,26 +33,29 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str) wxString out; out.reserve(str.length()); // we'll certainly need at least that - size_t len = str.Len(); - for (size_t i = 0; i < len; i++) + const wxString::const_iterator end = str.end(); + for ( wxString::const_iterator i = str.begin(); i != end; ++i ) { - switch ( str[i].GetValue() ) + switch ( (*i).GetValue() ) { case '<': - while (i < len && str[i] != '>') + while ( i != end && *i != '>' ) { - out << str[i++]; + out << *i++; } out << '>'; + if ( i == end ) + return out; break; case '\n': out << "
"; break; default: - out << str[i]; + out << *i; break; } } + return out; }