diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-14 18:02:18 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:56 +0200 |
commit | dc6222611ad14a33f642396558ba84ecba9d6605 (patch) | |
tree | d759020233b66be62c5539209a03842d283b67a9 /src/engine/user/input.cpp | |
parent | dbab54ebf134b6ab2cf719d7c26a191fbffeed34 (diff) |
perf: add noexcept almost everywhere
Diffstat (limited to 'src/engine/user/input.cpp')
-rw-r--r-- | src/engine/user/input.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/user/input.cpp b/src/engine/user/input.cpp index 1dc7f63..62aef67 100644 --- a/src/engine/user/input.cpp +++ b/src/engine/user/input.cpp @@ -2,7 +2,7 @@ #include <unistd.h> -void InputHandler::listen() const +void InputHandler::listen() const noexcept { char character = 0; @@ -12,7 +12,7 @@ void InputHandler::listen() const } } -void InputHandler::attach(const char &event, Callback callback) +void InputHandler::attach(const char &event, Callback callback) noexcept { if (_key_observers.count(event) == 0) { @@ -22,7 +22,7 @@ void InputHandler::attach(const char &event, Callback callback) _key_observers[event].push_back(callback); } -void InputHandler::notify(const char &event) const +void InputHandler::notify(const char &event) const noexcept { if (_key_observers.count(event) == 0) { @@ -35,7 +35,7 @@ void InputHandler::notify(const char &event) const } } -void InputHandler::enter_raw_mode() +void InputHandler::enter_raw_mode() noexcept { if (_original_termios == nullptr) { @@ -51,7 +51,7 @@ void InputHandler::enter_raw_mode() tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw_termios); } -void InputHandler::leave_raw_mode() +void InputHandler::leave_raw_mode() noexcept { if (_original_termios == nullptr) { |