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/RunStyles.cxx | |
parent | 1d41f1635e3a01bd99f0beb689c4d3ff6fea6e30 (diff) | |
download | scintilla-mirror-91c4a9ff07821dce93dab3ffd77df081893b723d.tar.gz |
Use unique_ptr fpr Partitioning, RunStyles, SparseVector, PositionCache and
Document.
Diffstat (limited to 'src/RunStyles.cxx')
-rw-r--r-- | src/RunStyles.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
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<int>(); + starts.reset(new Partitioning(8)); + styles.reset(new SplitVector<int>()); 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<int>(); + starts.reset(new Partitioning(8)); + styles.reset(new SplitVector<int>()); styles->InsertValue(0, 2, 0); } |