Bug 1470985 - EqualChars should just call ArrayEqual. - r=waldo
MozReview-Commit-ID: Cmj4KwGidNv
--- a/js/src/util/Text.h
+++ b/js/src/util/Text.h
@@ -52,36 +52,21 @@ extern int32_t
js_fputs(const char16_t* s, FILE* f);
namespace js {
class StringBuffer;
template <typename Char1, typename Char2>
inline bool
-EqualChars(const Char1* s1, const Char2* s2, size_t len);
-
-template <typename Char1>
-inline bool
-EqualChars(const Char1* s1, const Char1* s2, size_t len)
+EqualChars(const Char1* s1, const Char2* s2, size_t len)
{
return mozilla::ArrayEqual(s1, s2, len);
}
-template <typename Char1, typename Char2>
-inline bool
-EqualChars(const Char1* s1, const Char2* s2, size_t len)
-{
- for (const Char1* s1end = s1 + len; s1 < s1end; s1++, s2++) {
- if (*s1 != *s2)
- return false;
- }
- return true;
-}
-
// Return less than, equal to, or greater than zero depending on whether
// s1 is less than, equal to, or greater than s2.
template <typename Char1, typename Char2>
inline int32_t
CompareChars(const Char1* s1, size_t len1, const Char2* s2, size_t len2)
{
size_t n = Min(len1, len2);
for (size_t i = 0; i < n; i++) {