diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-10-15 20:30:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-17 09:05:09 +0200 |
commit | 79fe112cdd9d59982739c04026297055e4bd8ab0 (patch) | |
tree | 5128e447c93d809b0d145e844f024c6c7d26e4f7 /sc | |
parent | b8c6a3486bb11c61539a19ae72fc938f67e9470e (diff) |
Simplify ScCompressedArray constructor
nobody is setting a custom delta
Change-Id: I5dd9ac691fb226697eb8cb2b6b0b673552a4f049
Reviewed-on: https://gerrit.libreoffice.org/43437
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/compressedarray.hxx | 11 | ||||
-rw-r--r-- | sc/source/core/data/compressedarray.cxx | 9 |
2 files changed, 7 insertions, 13 deletions
diff --git a/sc/inc/compressedarray.hxx b/sc/inc/compressedarray.hxx index 86063049b774..93cbac83172d 100644 --- a/sc/inc/compressedarray.hxx +++ b/sc/inc/compressedarray.hxx @@ -25,8 +25,6 @@ #include "scdllapi.h" -const size_t nScCompressedArrayDelta = 4; - /** Compressed array of row (or column) entries, e.g. heights, flags, ... The array stores ranges of values such that equal consecutive values occupy only @@ -70,8 +68,7 @@ public: /** Construct with nMaxAccess=MAXROW, for example. */ ScCompressedArray( A nMaxAccess, - const D& rValue, - size_t nDelta = nScCompressedArrayDelta ); + const D& rValue ); /** Construct from a plain array of D */ ScCompressedArray( A nMaxAccess, const D* pDataArray, size_t nDataCount ); @@ -119,7 +116,6 @@ public: protected: size_t nCount; size_t nLimit; - size_t nDelta; DataEntry* pData; A nMaxAccess; }; @@ -176,9 +172,8 @@ template< typename A, typename D > class ScBitMaskCompressedArray : public ScCom { public: ScBitMaskCompressedArray( A nMaxAccessP, - const D& rValue, - size_t nDeltaP = nScCompressedArrayDelta ) - : ScCompressedArray<A,D>( nMaxAccessP, rValue, nDeltaP) + const D& rValue ) + : ScCompressedArray<A,D>( nMaxAccessP, rValue ) {} ScBitMaskCompressedArray( A nMaxAccessP, const D* pDataArray, size_t nDataCount ) diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index a1426792086d..6d4c67fa0e61 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -23,12 +23,12 @@ #include <algorithm> +static const size_t nScCompressedArrayDelta = 4; + template< typename A, typename D > -ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue, - size_t nDeltaP ) +ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue ) : nCount(1) , nLimit(1) - , nDelta( nDeltaP > 0 ? nDeltaP : 1) , pData( new DataEntry[1]) , nMaxAccess( nMaxAccessP) { @@ -41,7 +41,6 @@ ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D* pDataArray, size_t nDataCount ) : nCount(0) , nLimit( nDataCount) - , nDelta( nScCompressedArrayDelta) , pData( new DataEntry[nDataCount]) , nMaxAccess( nMaxAccessP) { @@ -127,7 +126,7 @@ void ScCompressedArray<A,D>::SetValue( A nStart, A nEnd, const D& rValue ) size_t nNeeded = nCount + 2; if (nLimit < nNeeded) { - nLimit += nDelta; + nLimit += nScCompressedArrayDelta; if (nLimit < nNeeded) nLimit = nNeeded; DataEntry* pNewData = new DataEntry[nLimit]; |