From 229ede80e2c3ef3a0aafeca663592495f183eac8 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 8 Jul 2016 16:59:05 -0400 Subject: [PATCH] Bug 1271751 - part 7 - remove nsTArray_CopyWith*::Copy*; r=erahm After all the previous patches, we never call these functions. Any copying required by nsTArray is taken care of by other means. --- xpcom/glue/nsTArray.h | 51 ------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h index 0b5f617d62e8..16dbd2175700 100644 --- a/xpcom/glue/nsTArray.h +++ b/xpcom/glue/nsTArray.h @@ -575,24 +575,12 @@ struct nsTArray_CopyWithMemutils { const static bool allowRealloc = true; - static void CopyNonOverlappingRegion(void* aDest, const void* aSrc, size_t aCount, - size_t aElemSize) - { - memcpy(aDest, aSrc, aCount * aElemSize); - } - static void MoveNonOverlappingRegionWithHeader(void* aDest, const void* aSrc, size_t aCount, size_t aElemSize) { memcpy(aDest, aSrc, sizeof(nsTArrayHeader) + aCount * aElemSize); } - static void CopyOverlappingRegion(void* aDest, const void* aSrc, size_t aCount, - size_t aElemSize) - { - memmove(aDest, aSrc, aCount * aElemSize); - } - static void MoveOverlappingRegion(void* aDest, void* aSrc, size_t aCount, size_t aElemSize) { @@ -617,24 +605,6 @@ struct nsTArray_CopyWithConstructors const static bool allowRealloc = false; - static void CopyNonOverlappingRegion(void* aDest, void* aSrc, size_t aCount, - size_t aElemSize) - { - ElemType* destElem = static_cast(aDest); - ElemType* srcElem = static_cast(aSrc); - ElemType* destElemEnd = destElem + aCount; -#ifdef DEBUG - ElemType* srcElemEnd = srcElem + aCount; - MOZ_ASSERT(srcElemEnd <= destElem || srcElemEnd > destElemEnd); -#endif - while (destElem != destElemEnd) { - traits::Construct(destElem, *srcElem); - traits::Destruct(srcElem); - ++destElem; - ++srcElem; - } - } - static void MoveNonOverlappingRegionWithHeader(void* aDest, void* aSrc, size_t aCount, size_t aElemSize) { @@ -646,27 +616,6 @@ struct nsTArray_CopyWithConstructors aCount, aElemSize); } - static void CopyOverlappingRegion(void* aDest, void* aSrc, size_t aCount, - size_t aElemSize) - { - ElemType* destElem = static_cast(aDest); - ElemType* srcElem = static_cast(aSrc); - ElemType* destElemEnd = destElem + aCount; - ElemType* srcElemEnd = srcElem + aCount; - if (destElem == srcElem) { - return; // In practice, we don't do this. - } else if (srcElemEnd > destElem && srcElemEnd < destElemEnd) { - while (destElemEnd != destElem) { - --destElemEnd; - --srcElemEnd; - traits::Construct(destElemEnd, *srcElemEnd); - traits::Destruct(srcElem); - } - } else { - CopyNonOverlappingRegion(aDest, aSrc, aCount, aElemSize); - } - } - static void MoveOverlappingRegion(void* aDest, void* aSrc, size_t aCount, size_t aElemSize) {