Browse Source

adapted delete to delete[] in BitVector to match new[]

Former-commit-id: efa07c50f8 [formerly 98f2d9fa03]
Former-commit-id: bac56d6768
tempestpy_adaptions
dehnert 8 years ago
parent
commit
4f369f10e4
  1. 9
      src/storage/BitVector.cpp

9
src/storage/BitVector.cpp

@ -86,12 +86,11 @@ namespace storm {
buckets = new uint64_t[bucketCount](); buckets = new uint64_t[bucketCount]();
} }
} }
BitVector::~BitVector() { BitVector::~BitVector() {
if (buckets != nullptr) { if (buckets != nullptr) {
delete buckets;
delete[] buckets;
} }
} }
template<typename InputIterator> template<typename InputIterator>
@ -219,7 +218,7 @@ namespace storm {
std::fill_n(newBuckets + this->bucketCount(), newBucketCount - this->bucketCount(), 0); std::fill_n(newBuckets + this->bucketCount(), newBucketCount - this->bucketCount(), 0);
} }
if (buckets != nullptr) { if (buckets != nullptr) {
delete buckets;
delete[] buckets;
} }
buckets = newBuckets; buckets = newBuckets;
bitCount = newLength; bitCount = newLength;
@ -243,7 +242,7 @@ namespace storm {
uint64_t* newBuckets = new uint64_t[newBucketCount]; uint64_t* newBuckets = new uint64_t[newBucketCount];
std::copy_n(buckets, newBucketCount, newBuckets); std::copy_n(buckets, newBucketCount, newBuckets);
if (buckets != nullptr) { if (buckets != nullptr) {
delete buckets;
delete[] buckets;
} }
buckets = newBuckets; buckets = newBuckets;
bitCount = newLength; bitCount = newLength;

Loading…
Cancel
Save