]> git.saurik.com Git - wxWidgets.git/commitdiff
use iterators in HtmlizeLinebreaks()
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 21 Apr 2008 20:06:50 +0000 (20:06 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 21 Apr 2008 20:06:50 +0000 (20:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/m_pre.cpp

index b2a5cb89e555bf48a42f0dbd536554bdb6e071d2..c69db2129d5c362a15ef0ef07b44edf03945a860 100644 (file)
@@ -33,15 +33,14 @@ 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++)
+    for ( wxString::const_iterator i = str.begin(); i != str.end(); ++i )
     {
-        switch ( str[i].GetValue() )
+        switch ( (*i).GetValue() )
         {
             case '<':
-                while (i < len && str[i] != '>')
+                while ( i != str.end() && *i != '>')
                 {
-                    out << str[i++];
+                    out << *i++;
                 }
                 out << '>';
                 break;
@@ -49,7 +48,7 @@ static wxString LINKAGEMODE HtmlizeLinebreaks(const wxString& str)
                 out << "<br>";
                 break;
             default:
-                out << str[i];
+                out << *i;
                 break;
         }
     }