fix warning: variable 'previous_bit' set but not used [-Wunused-but-set-variable]