From 501d1f9ab73f49c835aa4e2028eb33e9a83b065b Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 21 Apr 2018 16:19:19 +1000 Subject: Backport: Code improvements - noexcept and intialization. Backport of changeset 6728:08bed3a35b28. --- src/PositionCache.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/PositionCache.h') 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; } }; -- cgit v1.2.3