1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00

Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr

This commit is contained in:
Gunnar Beutner 2021-05-01 21:10:08 +02:00 committed by Andreas Kling
parent 4e6f03a860
commit 6cf59b6ae9
58 changed files with 315 additions and 469 deletions

View file

@ -20,9 +20,7 @@ void KeyCallbackMachine::register_key_input_callback(Vector<Key> keys, Function<
void KeyCallbackMachine::key_pressed(Editor& editor, Key key)
{
#if CALLBACK_MACHINE_DEBUG
dbgln("Key<{}, {}> pressed, seq_length={}, {} things in the matching vector", key.key, key.modifiers, m_sequence_length, m_current_matching_keys.size());
#endif
dbgln_if(CALLBACK_MACHINE_DEBUG, "Key<{}, {}> pressed, seq_length={}, {} things in the matching vector", key.key, key.modifiers, m_sequence_length, m_current_matching_keys.size());
if (m_sequence_length == 0) {
VERIFY(m_current_matching_keys.is_empty());
@ -61,14 +59,14 @@ void KeyCallbackMachine::key_pressed(Editor& editor, Key key)
return;
}
#if CALLBACK_MACHINE_DEBUG
dbgln("seq_length={}, matching vector:", m_sequence_length);
for (auto& key : m_current_matching_keys) {
for (auto& k : key)
dbgln(" {}, {}", k.key, k.modifiers);
dbgln("");
if constexpr (CALLBACK_MACHINE_DEBUG) {
dbgln("seq_length={}, matching vector:", m_sequence_length);
for (auto& key : m_current_matching_keys) {
for (auto& k : key)
dbgln(" {}, {}", k.key, k.modifiers);
dbgln("");
}
}
#endif
m_should_process_this_key = false;
for (auto& key : m_current_matching_keys) {