From c22eea9c9ff11cf122cebdd06f796ba6cc6e3ba0 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 8 Jan 2008 06:05:07 +0000 Subject: [PATCH] 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 --- src/common/txtstrm.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 4792c10cce..e516fb4130 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -18,22 +18,14 @@ #if wxUSE_STREAMS +#include "wx/txtstrm.h" + #ifndef WX_PRECOMP #include "wx/crt.h" #endif -#include "wx/txtstrm.h" #include - -// ---------------------------------------------------------------------------- -// 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)) -- 2.47.2