diff options
author | Neil <nyamatongwe@gmail.com> | 2018-03-01 09:55:25 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-03-01 09:55:25 +1100 |
commit | 69f3505ba3066c23024dc6bb6878a339474581bf (patch) | |
tree | d1c11379b0b7bac940ba06c749a629703980c292 /src/LineMarker.cxx | |
parent | 3ed7408fb4c322183249afc7f0fce3b9f5de1cf1 (diff) | |
download | scintilla-mirror-69f3505ba3066c23024dc6bb6878a339474581bf.tar.gz |
Use make_unique in preference to new.
From Effective Modern C++ Item 21.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r-- | src/LineMarker.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index f556e77f8..e3c2c6713 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -25,17 +25,17 @@ using namespace Scintilla; void LineMarker::SetXPM(const char *textForm) { - pxpm.reset(new XPM(textForm)); + pxpm = std::make_unique<XPM>(textForm); markType = SC_MARK_PIXMAP; } void LineMarker::SetXPM(const char *const *linesForm) { - pxpm.reset(new XPM(linesForm)); + pxpm = std::make_unique<XPM>(linesForm); markType = SC_MARK_PIXMAP; } void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) { - image.reset(new RGBAImage(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage)); + image = std::make_unique<RGBAImage>(static_cast<int>(sizeRGBAImage.x), static_cast<int>(sizeRGBAImage.y), scale, pixelsRGBAImage); markType = SC_MARK_RGBAIMAGE; } |