Use ptrdiff_t in RangedPtr.

This commit is contained in:
Fedor 2019-05-20 09:01:24 +03:00
parent eecf3a3830
commit 1009e92f52

View File

@ -212,7 +212,7 @@ public:
return *this; return *this;
} }
T& operator[](int aIndex) const T& operator[](ptrdiff_t aIndex) const
{ {
MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T)); MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T));
return *create(mPtr + aIndex); return *create(mPtr + aIndex);