    for (auto e : *events) {
      if (e->which == cereal::Event::Which::CAN) {
        for (const auto &c : e->event.getCan()) {
          if (c.getSrc() == bus) {
            uint32_t address = c.getAddress();
            if (address == selected_address && dat.size() > byte_idx) {
              bit_to_find = ((dat[byte_idx] >> (7 - bit_idx)) & 1) != 0;
            }
            ++msg_count[address];
            if (bit_to_find == -1) continue;
 
</s> remove QList<FindSimilarBitsDlg::mismatched_struct> FindSimilarBitsDlg::calcBits(uint8_t bus, int bit_to_find, int min_msgs_cnt) {
 </s> add QList<FindSimilarBitsDlg::mismatched_struct> FindSimilarBitsDlg::calcBits(uint8_t bus, uint32_t selected_address, int byte_idx, int bit_idx, int min_msgs_cnt) { </s> remove   auto msg_mismatched = calcBits(bus_combo->currentText().toUInt(), bit_combo->currentIndex(), min_msgs->text().toInt());
 </s> add   uint32_t selected_address = msg_cb->currentData().toUInt();
  auto msg_mismatched = calcBits(bus_combo->currentText().toUInt(), selected_address, byte_idx_sb->value(), bit_idx_sb->value(), min_msgs->text().toInt());
          const auto dat = c.getDat();
    for (auto e : *events) {
      if (e->which == cereal::Event::Which::CAN) {
        for (const auto &c : e->event.getCan()) {
          if (c.getSrc() == bus) {
          const auto dat = c.getDat();
            uint32_t address = c.getAddress();
            if (address == selected_address && dat.size() > byte_idx) {
              bit_to_find = ((dat[byte_idx] >> (7 - bit_idx)) & 1) != 0;
            }
            ++msg_count[address];
            if (bit_to_find == -1) continue;
keep keep keep add keep keep keep keep keep keep
 cabana: fix find similar bits (#26918)

* dynamic find bit

* change

* Revert "change"

This reverts commit 12cf513e2725a52ee40b8999521adcd6ecb00221.

* change sorting and headers

* make perc a float

Co-authored-by: Shane Smiskol <shane@smiskol.com> 
tools/cabana/tools/findsimilarbits.cc