aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics/string_matrix.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-14 18:02:18 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commitdc6222611ad14a33f642396558ba84ecba9d6605 (patch)
treed759020233b66be62c5539209a03842d283b67a9 /src/engine/graphics/string_matrix.cpp
parentdbab54ebf134b6ab2cf719d7c26a191fbffeed34 (diff)
perf: add noexcept almost everywhere
Diffstat (limited to 'src/engine/graphics/string_matrix.cpp')
-rw-r--r--src/engine/graphics/string_matrix.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/engine/graphics/string_matrix.cpp b/src/engine/graphics/string_matrix.cpp
index 26d48df..ae06755 100644
--- a/src/engine/graphics/string_matrix.cpp
+++ b/src/engine/graphics/string_matrix.cpp
@@ -1,13 +1,13 @@
#include "string_matrix.hpp"
-StringMatrix::StringMatrix(const Bounds &bounds)
+StringMatrix::StringMatrix(const Bounds &bounds) noexcept
: _rows(bounds.get_height()), _columns(bounds.get_width())
{
_matrix.reserve(bounds.get_height());
_matrix.assign(_matrix.capacity(), std::vector<std::string_view>(bounds.get_width()));
};
-void StringMatrix::fill(std::string_view element)
+void StringMatrix::fill(std::string_view element) noexcept
{
for (uint32_t row = 0U; row < _matrix.capacity(); row++)
{
@@ -20,7 +20,7 @@ void StringMatrix::fill(std::string_view element)
}
}
-std::string_view StringMatrix::get(const Vector2 &pos) const
+std::string_view StringMatrix::get(const Vector2 &pos) const noexcept
{
auto x = static_cast<std::size_t>(pos.get_x());
auto y = static_cast<std::size_t>(pos.get_y());
@@ -28,7 +28,7 @@ std::string_view StringMatrix::get(const Vector2 &pos) const
return _matrix[y][x];
}
-void StringMatrix::set(const Vector2 &pos, std::string_view element)
+void StringMatrix::set(const Vector2 &pos, std::string_view element) noexcept
{
auto x = static_cast<std::size_t>(pos.get_x());
auto y = static_cast<std::size_t>(pos.get_y());
@@ -36,12 +36,12 @@ void StringMatrix::set(const Vector2 &pos, std::string_view element)
_matrix[y][x] = element;
}
-uint32_t StringMatrix::rows() const
+uint32_t StringMatrix::rows() const noexcept
{
return _rows;
}
-uint32_t StringMatrix::columns() const
+uint32_t StringMatrix::columns() const noexcept
{
return _columns;
}