| 95 | current_remote += std::max(bytes_read, bytes_to_next_page); |
| 96 | continue; |
| 97 | } |
| 98 | |
| 99 | const uintptr_t local_base = reinterpret_cast<uintptr_t>(buf.data()); |
| 100 | const uintptr_t local_end = local_base + bytes_read; |
| 101 | uintptr_t current_local = local_base; |
| 102 | |
| 103 | while (current_local < local_end) |
| 104 | { |
| 105 | uintptr_t found_local = findInRange(current_local, |
| 106 | local_end, |
| 107 | reinterpret_cast<const uint8_t *>(bytes), |
| 108 | mask); |
| 109 | if (!found_local) |
| 110 | break; |
| 111 | |
| 112 | const size_t offset = found_local - local_base; |
| 113 | results.push_back(current_remote + offset); |
| 114 | |
| 115 | current_local = found_local + 1; |
| 116 | } |
| 117 | |
| 118 | // Slide the window forward based on actual bytes read to handle chunk boundaries |
| 119 | current_remote += (bytes_read - pattern_len + 1); |
| 120 | } |
no test coverage detected