зеркало из https://github.com/mozilla/pjs.git
Bug 379339 StringBegins/EndsWith inconsistent with nsReadableUtils.cpp r=bsmedberg sr=darin
This commit is contained in:
Родитель
0c671547ab
Коммит
212b1c5362
|
@ -1228,32 +1228,32 @@ inline PRBool
|
|||
StringBeginsWith(const nsAString& aSource, const nsAString& aSubstring,
|
||||
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
||||
{
|
||||
return StringHead(aSource, aSubstring.Length()).
|
||||
Equals(aSubstring, aComparator);
|
||||
return aSubstring.Length() <= aSource.Length() &&
|
||||
StringHead(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
StringEndsWith(const nsAString& aSource, const nsAString& aSubstring,
|
||||
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
||||
{
|
||||
return StringTail(aSource, aSubstring.Length()).
|
||||
Equals(aSubstring, aComparator);
|
||||
return aSubstring.Length() <= aSource.Length() &&
|
||||
StringTail(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
StringBeginsWith(const nsACString& aSource, const nsACString& aSubstring,
|
||||
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
||||
{
|
||||
return StringHead(aSource, aSubstring.Length()).
|
||||
Equals(aSubstring, aComparator);
|
||||
return aSubstring.Length() <= aSource.Length() &&
|
||||
StringHead(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
StringEndsWith(const nsACString& aSource, const nsACString& aSubstring,
|
||||
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
||||
{
|
||||
return StringTail(aSource, aSubstring.Length()).
|
||||
Equals(aSubstring, aComparator);
|
||||
return aSubstring.Length() <= aSource.Length() &&
|
||||
StringTail(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче