From: Jeremiah Date: Sun, 14 May 2017 15:01:01 +0000 (-0700) Subject: faster, less bits :) X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b9b2244b8275066d1226fba0fb75747a194f0553;p=qmk_firmware.git faster, less bits :) --- 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){ static inline bool countones(matrix_row_t row) { - int count = 0; - while (row > 0){ - count += 1; - row &= row-1; - } - if (count > 1){ - return true; - } - return false; + row &= row-1; + return row; } static inline bool has_ghost_in_row(uint8_t row, matrix_row_t rowdata)