From 50850f828cdbd4e896a528b95fcf8ef931f766b2 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Thu, 27 May 1999 07:59:16 +0000 Subject: [PATCH] fixed bug in nsString2::find() -- this will soon use boyer-moore git-svn-id: svn://10.0.0.236/trunk@32925 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsStr.cpp | 24 ++---------------------- mozilla/xpcom/ds/nsStr.cpp | 24 ++---------------------- mozilla/xpcom/string/obsolete/nsStr.cpp | 24 ++---------------------- 3 files changed, 6 insertions(+), 66 deletions(-) diff --git a/mozilla/string/obsolete/nsStr.cpp b/mozilla/string/obsolete/nsStr.cpp index 528d321c2ee..28e641f585c 100644 --- a/mozilla/string/obsolete/nsStr.cpp +++ b/mozilla/string/obsolete/nsStr.cpp @@ -450,21 +450,11 @@ PRInt32 nsStr::FindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnor PRBool matches=PR_TRUE; while((++theSubIndex0) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } - if(matches) + if(matches) { return index; - if(-10) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } //while } //if - if(matches) + if(matches) { return index; - if(-10) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } - if(matches) + if(matches) { return index; - if(-10) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } //while } //if - if(matches) + if(matches) { return index; - if(-10) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } - if(matches) + if(matches) { return index; - if(-10) { - if(theFirstTargetChar==theChar){ - PRUnichar theDestJumpChar=GetCharAt(aDest,index+theTargetMax); - if(theDestJumpChar==theLastTargetChar) { - theNewStartPos=index; //this lets us jump ahead during our search where possible. - }//if - }//if - }//if PRUnichar theTargetChar=GetCharAt(aTarget,theSubIndex); matches=PRBool(theChar==theTargetChar); } //while } //if - if(matches) + if(matches) { return index; - if(-1