Closed Bug 235504 Opened 20 years ago Closed 20 years ago

Remove nsCString::EqualsWithConversion(const char*)

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha1

People

(Reporter: Biesinger, Assigned: Biesinger)

Details

Attachments

(1 file, 1 obsolete file)

There's no need for this function. Comparing a CString with a char* string does
not do any conversion.
Priority: -- → P3
Target Milestone: --- → mozilla1.8alpha
Status: NEW → ASSIGNED
Attached patch patch (obsolete) — Splinter Review
Comment on attachment 145208 [details] [diff] [review]
patch

>Index: xpcom/string/public/nsTString.h

>+#ifdef CharT_is_char
>+      PRBool EqualsIgnoreCase( const char* aString, PRInt32 aCount=-1 ) const {
>+        return Compare(aString, PR_TRUE, aCount) == 0;
>+      }
>+#endif
>+
>+#ifdef CharT_is_PRUnichar
>         /**
>          * Equality check between given string and this string.
>          *
>          * @param   aString is the string to check
>          * @param   aIgnoreCase tells us how to treat case
>          * @param   aCount tells us how many chars to compare
>          * @return  boolean
>          */
> 
>       NS_COM PRBool EqualsWithConversion( const char* aString, PRBool aIgnoreCase=PR_FALSE, PRInt32 aCount=-1 ) const;
>       PRBool EqualsIgnoreCase( const char* aString, PRInt32 aCount=-1 ) const
>         {
>           return EqualsWithConversion(aString, PR_TRUE, aCount);
>         }

I think it would be better to declare the CharT_is_char version of
EqualsIgnoreCase underneath the comment that formerly documented
its behavior.  That's where the other one lives.

Maybe you could use #else also?

r=darin
Attachment #145208 - Flags: review?(darin) → review+
Attachment #145208 - Attachment is obsolete: true
Attachment #145281 - Flags: superreview?(dbaron)
Attachment #145281 - Flags: superreview?(dbaron) → superreview+
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
I backed out the string api changes for the moment because they caused bustage
and I don't currently have time for dealing with it...

I'll reland sometime soon
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
ok, checked in again
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: