зеркало из 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,
|
StringBeginsWith(const nsAString& aSource, const nsAString& aSubstring,
|
||||||
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
||||||
{
|
{
|
||||||
return StringHead(aSource, aSubstring.Length()).
|
return aSubstring.Length() <= aSource.Length() &&
|
||||||
Equals(aSubstring, aComparator);
|
StringHead(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PRBool
|
inline PRBool
|
||||||
StringEndsWith(const nsAString& aSource, const nsAString& aSubstring,
|
StringEndsWith(const nsAString& aSource, const nsAString& aSubstring,
|
||||||
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
nsAString::ComparatorFunc aComparator = nsAString::DefaultComparator)
|
||||||
{
|
{
|
||||||
return StringTail(aSource, aSubstring.Length()).
|
return aSubstring.Length() <= aSource.Length() &&
|
||||||
Equals(aSubstring, aComparator);
|
StringTail(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PRBool
|
inline PRBool
|
||||||
StringBeginsWith(const nsACString& aSource, const nsACString& aSubstring,
|
StringBeginsWith(const nsACString& aSource, const nsACString& aSubstring,
|
||||||
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
||||||
{
|
{
|
||||||
return StringHead(aSource, aSubstring.Length()).
|
return aSubstring.Length() <= aSource.Length() &&
|
||||||
Equals(aSubstring, aComparator);
|
StringHead(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PRBool
|
inline PRBool
|
||||||
StringEndsWith(const nsACString& aSource, const nsACString& aSubstring,
|
StringEndsWith(const nsACString& aSource, const nsACString& aSubstring,
|
||||||
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
nsACString::ComparatorFunc aComparator = nsACString::DefaultComparator)
|
||||||
{
|
{
|
||||||
return StringTail(aSource, aSubstring.Length()).
|
return aSubstring.Length() <= aSource.Length() &&
|
||||||
Equals(aSubstring, aComparator);
|
StringTail(aSource, aSubstring.Length()).Equals(aSubstring, aComparator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче