From dc6222611ad14a33f642396558ba84ecba9d6605 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 14 Mar 2022 18:02:18 +0100 Subject: perf: add noexcept almost everywhere --- src/engine/data/bounds.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/engine/data/bounds.cpp') diff --git a/src/engine/data/bounds.cpp b/src/engine/data/bounds.cpp index 41b6dc0..fdf8c6b 100644 --- a/src/engine/data/bounds.cpp +++ b/src/engine/data/bounds.cpp @@ -1,48 +1,48 @@ #include "bounds.hpp" -Bounds::Bounds(const BoundsOptions &options) +Bounds::Bounds(const BoundsOptions &options) noexcept : _width(options.width), _height(options.height) { } -uint32_t Bounds::get_width() const noexcept +Bounds::Value Bounds::get_width() const noexcept { return _width; } -void Bounds::set_width(uint32_t width) noexcept +void Bounds::set_width(Bounds::Value width) noexcept { _width = width; } -uint32_t Bounds::get_height() const noexcept +Bounds::Value Bounds::get_height() const noexcept { return _height; } -void Bounds::set_height(uint32_t height) noexcept +void Bounds::set_height(Bounds::Value height) noexcept { _height = height; } CoordsValidation Bounds::validate_coords(const Vector2 &coords) const noexcept { - if (static_cast(coords.get_x()) >= _width) + if (static_cast(coords.get_x()) >= _width) { return CoordsValidation::X_HIGH; } - if (static_cast(coords.get_x()) <= 0) + if (static_cast(coords.get_x()) <= 0) { return CoordsValidation::X_LOW; } - if (static_cast(coords.get_y()) >= _height) + if (static_cast(coords.get_y()) >= _height) { return CoordsValidation::Y_HIGH; } - if (static_cast(coords.get_y()) <= 0) + if (static_cast(coords.get_y()) <= 0) { return CoordsValidation::Y_LOW; } -- cgit v1.2.3-18-g5258