]> git.saurik.com Git - wxWidgets.git/commitdiff
speed up ReadWord by using more efficient separator searching
authorPaul Cornett <paulcor@bullseye.com>
Tue, 8 Jan 2008 06:05:07 +0000 (06:05 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 8 Jan 2008 06:05:07 +0000 (06:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/txtstrm.cpp

index 4792c10cce76b6e9221dafc9fe54ffafe9e0b1ed..e516fb413034221ee8f7fcb8dd5cc965f2688e39 100644 (file)
 
 #if wxUSE_STREAMS
 
+#include "wx/txtstrm.h"
+
 #ifndef WX_PRECOMP
     #include "wx/crt.h"
 #endif
 
-#include "wx/txtstrm.h"
 #include <ctype.h>
 
-
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-// Unix: "\n"
-// Dos:  "\r\n"
-// Mac:  "\r"
-
 // ----------------------------------------------------------------------------
 // wxTextInputStream
 // ----------------------------------------------------------------------------
@@ -109,7 +101,7 @@ wxChar wxTextInputStream::NextNonSeparators()
 
         if (c != wxT('\n') &&
             c != wxT('\r') &&
-            !m_separators.Contains(c))
+            m_separators.Find(c) < 0)
           return c;
     }
 
@@ -229,7 +221,7 @@ wxString wxTextInputStream::ReadWord()
         if(c == wxEOT)
             break;
 
-        if (m_separators.Contains(c))
+        if (m_separators.Find(c) >= 0)
             break;
 
         if (EatEOL(c))