diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-21 16:19:19 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-21 16:19:19 +1000 |
commit | 501d1f9ab73f49c835aa4e2028eb33e9a83b065b (patch) | |
tree | 95e6417c1dc734151975236ad1d5fe1712270e2f /src | |
parent | ad920ffd5c74a25c3328f4cbec0afea0b13d5f0f (diff) | |
download | scintilla-mirror-501d1f9ab73f49c835aa4e2028eb33e9a83b065b.tar.gz |
Backport: Code improvements - noexcept and intialization.
Backport of changeset 6728:08bed3a35b28.
Diffstat (limited to 'src')
-rw-r--r-- | src/EditModel.cxx | 2 | ||||
-rw-r--r-- | src/PositionCache.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/EditModel.cxx b/src/EditModel.cxx index df9efb689..a428f079c 100644 --- a/src/EditModel.cxx +++ b/src/EditModel.cxx @@ -51,7 +51,7 @@ using namespace Scintilla; Caret::Caret() : active(false), on(false), period(500) {} -EditModel::EditModel() { +EditModel::EditModel() : braces{} { inOverstrike = false; xOffset = 0; trackLineWidth = false; diff --git a/src/PositionCache.h b/src/PositionCache.h index f23823bdf..fcbb1cdf7 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -23,11 +23,11 @@ public: double x; double y; - explicit PointDocument(double x_ = 0, double y_ = 0) : x(x_), y(y_) { + explicit PointDocument(double x_ = 0, double y_ = 0) noexcept : x(x_), y(y_) { } // Conversion from Point. - explicit PointDocument(Point pt) : x(pt.x), y(pt.y) { + explicit PointDocument(Point pt) noexcept : x(pt.x), y(pt.y) { } }; @@ -172,10 +172,10 @@ struct TextSegment { int start; int length; const Representation *representation; - TextSegment(int start_=0, int length_=0, const Representation *representation_=0) : + TextSegment(int start_=0, int length_=0, const Representation *representation_=nullptr) noexcept : start(start_), length(length_), representation(representation_) { } - int end() const { + int end() const noexcept { return start + length; } }; |