diff options
| author | Neil <nyamatongwe@gmail.com> | 2017-05-10 13:58:06 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2017-05-10 13:58:06 +1000 | 
| commit | 91c4a9ff07821dce93dab3ffd77df081893b723d (patch) | |
| tree | 04717f8b9f4c64280f07cc6c2d402e2753700683 /src/Partitioning.h | |
| parent | 1d41f1635e3a01bd99f0beb689c4d3ff6fea6e30 (diff) | |
| download | scintilla-mirror-91c4a9ff07821dce93dab3ffd77df081893b723d.tar.gz | |
Use unique_ptr fpr Partitioning, RunStyles, SparseVector, PositionCache and
Document.
Diffstat (limited to 'src/Partitioning.h')
| -rw-r--r-- | src/Partitioning.h | 10 | 
1 files changed, 3 insertions, 7 deletions
| diff --git a/src/Partitioning.h b/src/Partitioning.h index 726b7fcdb..968220db7 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -60,7 +60,7 @@ private:  	// there may be a step somewhere in the list.  	int stepPartition;  	int stepLength; -	SplitVectorWithRangeAdd *body; +	std::unique_ptr<SplitVectorWithRangeAdd> body;  	// Move step forward  	void ApplyStep(int partitionUpTo) { @@ -83,7 +83,7 @@ private:  	}  	void Allocate(int growSize) { -		body = new SplitVectorWithRangeAdd(growSize); +		body.reset(new SplitVectorWithRangeAdd(growSize));  		stepPartition = 0;  		stepLength = 0;  		body->Insert(0, 0);	// This value stays 0 for ever @@ -100,8 +100,6 @@ public:  	void operator=(const Partitioning &) = delete;  	~Partitioning() { -		delete body; -		body = 0;  	}  	int Partitions() const { @@ -191,9 +189,7 @@ public:  	}  	void DeleteAll() { -		int growSize = body->GetGrowSize(); -		delete body; -		Allocate(growSize); +		Allocate(body->GetGrowSize());  	}  }; | 
