From 21b660fa07455a0173770ccab1cd21d7c7625014 Mon Sep 17 00:00:00 2001
From: Sergey Vlasov <sigprof@gmail.com>
Date: Sat, 20 May 2023 15:15:55 +0300
Subject: [PATCH] Move `pre_process_record_kb()` before `process_combo()`
 (#20969)

---
 docs/understanding_qmk.md | 2 +-
 quantum/quantum.c         | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md
index 9c5f0419a1..7cb46bd8cf 100644
--- a/docs/understanding_qmk.md
+++ b/docs/understanding_qmk.md
@@ -129,9 +129,9 @@ The `process_record()` function itself is deceptively simple, but hidden within
 
 * [`void action_exec(keyevent_t event)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/action.c#L78-L140)
     * [`void pre_process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L204)
-      * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_combo.c#L521)
       * [`bool pre_process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/27119fa77e8a1b95fff80718d3db4f3e32849298/quantum/quantum.c#L117)
         * [`bool pre_process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/27119fa77e8a1b95fff80718d3db4f3e32849298/quantum/quantum.c#L121)
+      * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/process_keycode/process_combo.c#L521)
   * [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/action.c#L254)
     * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L224)
       * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/325da02e57fe7374e77b82cb00360ba45167e25c/quantum/quantum.c#L225)
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 950be3182e..fdc24fa2d0 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -211,12 +211,11 @@ uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
 /* Get keycode, and then process pre tapping functionality */
 bool pre_process_record_quantum(keyrecord_t *record) {
     uint16_t keycode = get_record_keycode(record, true);
+    return pre_process_record_kb(keycode, record) &&
 #ifdef COMBO_ENABLE
-    if (!(process_combo(keycode, record))) {
-        return false;
-    }
+           process_combo(keycode, record) &&
 #endif
-    return pre_process_record_kb(keycode, record);
+           true;
 }
 
 /* Get keycode, and then call keyboard function */