]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxHtmlParser::SkipCommentTag() to run the initial test in O(1) instead of O...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Aug 2007 05:45:11 +0000 (05:45 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Aug 2007 05:45:11 +0000 (05:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlpars.cpp

index 2d3b86f1eeb49b050067dd25d8b04b1a20649275..4d7342ec30292df62da60161d2ad75d625221a29 100644 (file)
@@ -953,7 +953,7 @@ wxHtmlParser::SkipCommentTag(wxString::const_iterator& start,
     wxString::const_iterator p = start;
 
     // comments begin with "<!--" in HTML 4.0
-    if ( end - p < 3 || *++p != '!' || *++p != '-' || *++p != '-' )
+    if ( p > end - 3 || *++p != '!' || *++p != '-' || *++p != '-' )
     {
         // not a comment at all
         return false;