Bug 1202317. Support PodEqual over fixed-length arrays. r=Waldo

--HG--
extra : commitid : CojJ669FPWd
extra : rebase_source : fd81c9367dcb9dacf9e5ba137fe9a4ef31a5853e
This commit is contained in:
Robert O'Callahan 2015-09-07 17:07:59 +12:00
parent ff15b1bada
commit 5d455e0375

View File

@ -180,6 +180,17 @@ PodEqual(const T* one, const T* two, size_t len)
return !memcmp(one, two, len * sizeof(T));
}
/*
* Determine whether the |N| elements at |one| are memory-identical to the
* |N| elements at |two|.
*/
template <class T, size_t N>
static MOZ_ALWAYS_INLINE bool
PodEqual(const T (&one)[N], const T (&two)[N])
{
return PodEqual(one, two, N);
}
} // namespace mozilla
#endif /* mozilla_PodOperations_h */