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/user/cursor.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/engine/user/cursor.cpp') diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp index 663d56a..b02a9bc 100644 --- a/src/engine/user/cursor.cpp +++ b/src/engine/user/cursor.cpp @@ -5,7 +5,7 @@ #include #include -CursorController::CursorController() : _position({.x = 0, .y = 0}) {} +CursorController::CursorController() noexcept : _position({.x = 0, .y = 0}) {} void CursorController::move(const Vector2 &direction, const uint32_t &amount) noexcept { @@ -32,12 +32,6 @@ Vector2 CursorController::where() const noexcept return _position; } -void CursorController::hide() -{ - fmt::print(CURSOR_INVISIBLE, fmt::arg("esc", ESC)); - std::cout.flush(); -} - void CursorController::ensure_position() noexcept { fmt::print(REQUEST_CURSOR_POSITION, fmt::arg("esc", ESC)); @@ -51,7 +45,13 @@ void CursorController::ensure_position() noexcept _position = Vector2(vector2_options); } -void CursorController::show() +void CursorController::hide() noexcept +{ + fmt::print(CURSOR_INVISIBLE, fmt::arg("esc", ESC)); + std::cout.flush(); +} + +void CursorController::show() noexcept { fmt::print(CURSOR_VISIBLE, fmt::arg("esc", ESC)); std::cout.flush(); -- cgit v1.2.3-18-g5258