aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-09-17 07:38:35 +1000
committerZufu Liu <unknown>2021-09-17 07:38:35 +1000
commitf99432484eb77df0d0ea1871ed34ffb74b501fba (patch)
treed841e4a9769d9ad348de211ca24c79ee944fff64
parent4840ebf15e51588a3e2f6caf16832ae83ffb9717 (diff)
downloadscintilla-mirror-f99432484eb77df0d0ea1871ed34ffb74b501fba.tar.gz
Add noexcept and constexpr where reasonable.
-rw-r--r--src/LineMarker.cxx2
-rw-r--r--src/ViewStyle.cxx2
-rw-r--r--src/ViewStyle.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 5bfb89307..df8c3d55a 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -326,7 +326,7 @@ void LineMarker::DrawFoldingMark(Surface *surface, const PRectangle &rcWhole, Fo
void LineMarker::AlignedPolygon(Surface *surface, const Point *pts, size_t npts) const {
const XYPOSITION move = strokeWidth / 2.0;
std::vector<Point> points;
- std::transform(pts, pts + npts, std::back_inserter(points), [=](Point pt)->Point {
+ std::transform(pts, pts + npts, std::back_inserter(points), [=](Point pt) noexcept ->Point {
return Point(pt.x + move, pt.y + move);
});
surface->Polygon(points.data(), std::size(points), FillStroke(back, fore, strokeWidth));
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index c375bffab..0288a430a 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -554,7 +554,7 @@ ColourRGBA ViewStyle::WrapColour() const {
void ViewStyle::AddMultiEdge(int column, ColourRGBA colour) {
theMultiEdge.insert(
std::upper_bound(theMultiEdge.begin(), theMultiEdge.end(), column,
- [](const EdgeProperties &a, const EdgeProperties &b) {
+ [](const EdgeProperties &a, const EdgeProperties &b) noexcept {
return a.column < b.column;
}),
EdgeProperties(column, colour));
diff --git a/src/ViewStyle.h b/src/ViewStyle.h
index 52ec793bc..de56c0895 100644
--- a/src/ViewStyle.h
+++ b/src/ViewStyle.h
@@ -86,7 +86,7 @@ struct WrapAppearance {
struct EdgeProperties {
int column = 0;
ColourRGBA colour;
- EdgeProperties(int column_ = 0, ColourRGBA colour_ = ColourRGBA::FromRGB(0)) noexcept :
+ constexpr EdgeProperties(int column_ = 0, ColourRGBA colour_ = ColourRGBA::FromRGB(0)) noexcept :
column(column_), colour(colour_) {
}
};