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

This commit is contained in:
Robert O'Callahan 2015-09-07 17:07:59 +12:00
parent 94aec1bd5e
commit 038ddb54c8

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 */