From 91c4a9ff07821dce93dab3ffd77df081893b723d Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 10 May 2017 13:58:06 +1000 Subject: Use unique_ptr fpr Partitioning, RunStyles, SparseVector, PositionCache and Document. --- src/RunStyles.cxx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/RunStyles.cxx') diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index 3e611bc92..38a6ba799 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -71,16 +71,12 @@ void RunStyles::RemoveRunIfSameAsPrevious(int run) { } RunStyles::RunStyles() { - starts = new Partitioning(8); - styles = new SplitVector(); + starts.reset(new Partitioning(8)); + styles.reset(new SplitVector()); styles->InsertValue(0, 2, 0); } RunStyles::~RunStyles() { - delete starts; - starts = NULL; - delete styles; - styles = NULL; } int RunStyles::Length() const { @@ -201,12 +197,8 @@ void RunStyles::InsertSpace(int position, int insertLength) { } void RunStyles::DeleteAll() { - delete starts; - starts = NULL; - delete styles; - styles = NULL; - starts = new Partitioning(8); - styles = new SplitVector(); + starts.reset(new Partitioning(8)); + styles.reset(new SplitVector()); styles->InsertValue(0, 2, 0); } -- cgit v1.2.3