speed up ReadWord by using more efficient separator searching

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-01-08 06:05:07 +00:00
parent 1663ec5f74
commit c22eea9c9f

View File

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