From 038ddb54c8475c986aedeada87d58edad913bda6 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 7 Sep 2015 17:07:59 +1200 Subject: [PATCH] Bug 1202317. Support PodEqual over fixed-length arrays. r=Waldo --- mfbt/PodOperations.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mfbt/PodOperations.h b/mfbt/PodOperations.h index 9d7b5850ab7..e6f4df21ee5 100644 --- a/mfbt/PodOperations.h +++ b/mfbt/PodOperations.h @@ -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 +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 */