aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-01 09:55:25 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-01 09:55:25 +1100
commit69f3505ba3066c23024dc6bb6878a339474581bf (patch)
treed1c11379b0b7bac940ba06c749a629703980c292 /src/RunStyles.cxx
parent3ed7408fb4c322183249afc7f0fce3b9f5de1cf1 (diff)
downloadscintilla-mirror-69f3505ba3066c23024dc6bb6878a339474581bf.tar.gz
Use make_unique in preference to new.
From Effective Modern C++ Item 21.
Diffstat (limited to 'src/RunStyles.cxx')
-rw-r--r--src/RunStyles.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx
index f3939bbd2..6dbfb4c4b 100644
--- a/src/RunStyles.cxx
+++ b/src/RunStyles.cxx
@@ -76,8 +76,8 @@ void RunStyles<DISTANCE, STYLE>::RemoveRunIfSameAsPrevious(DISTANCE run) {
template <typename DISTANCE, typename STYLE>
RunStyles<DISTANCE, STYLE>::RunStyles() {
- starts.reset(new Partitioning<DISTANCE>(8));
- styles.reset(new SplitVector<STYLE>());
+ starts = std::make_unique<Partitioning<DISTANCE>>(8);
+ styles = std::make_unique<SplitVector<STYLE>>();
styles->InsertValue(0, 2, 0);
}
@@ -212,8 +212,8 @@ void RunStyles<DISTANCE, STYLE>::InsertSpace(DISTANCE position, DISTANCE insertL
template <typename DISTANCE, typename STYLE>
void RunStyles<DISTANCE, STYLE>::DeleteAll() {
- starts.reset(new Partitioning<DISTANCE>(8));
- styles.reset(new SplitVector<STYLE>());
+ starts = std::make_unique<Partitioning<DISTANCE>>(8);
+ styles = std::make_unique<SplitVector<STYLE>>();
styles->InsertValue(0, 2, 0);
}