diff options
| author | Jeremiah <barrar@users.noreply.github.com> | 2017-05-14 08:01:01 -0700 |
|---|---|---|
| committer | Jeremiah <barrar@users.noreply.github.com> | 2017-05-14 08:01:01 -0700 |
| commit | b9b2244b8275066d1226fba0fb75747a194f0553 (patch) | |
| tree | 0058fd00c6ad7c1364fa2582ea47b46c9ff89588 /tmk_core/common/keyboard.c | |
| parent | 63d9698d5c7a088b2eb8220a9a44c8adbca86326 (diff) | |
| download | qmk_firmware-b9b2244b8275066d1226fba0fb75747a194f0553.tar.gz qmk_firmware-b9b2244b8275066d1226fba0fb75747a194f0553.zip | |
faster, less bits :)
Diffstat (limited to 'tmk_core/common/keyboard.c')
| -rw-r--r-- | tmk_core/common/keyboard.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index fa17ffca2..20b867285 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
| @@ -76,15 +76,8 @@ static matrix_row_t get_real_keys(uint8_t row, matrix_row_t rowdata){ | |||
| 76 | 76 | ||
| 77 | static inline bool countones(matrix_row_t row) | 77 | static inline bool countones(matrix_row_t row) |
| 78 | { | 78 | { |
| 79 | int count = 0; | 79 | row &= row-1; |
| 80 | while (row > 0){ | 80 | return row; |
| 81 | count += 1; | ||
| 82 | row &= row-1; | ||
| 83 | } | ||
| 84 | if (count > 1){ | ||
| 85 | return true; | ||
| 86 | } | ||
| 87 | return false; | ||
| 88 | } | 81 | } |
| 89 | 82 | ||
| 90 | static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) | 83 | static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata) |
