search for a given byte in the stream, and remain positioned on it
| 709 | |
| 710 | //! search for a given byte in the stream, and remain positioned on it |
| 711 | void FindByte(uint8_t ch) |
| 712 | { |
| 713 | while (true) { |
| 714 | if (m_read_pos == nSrcPos) |
| 715 | Fill(); |
| 716 | if (vchBuf[m_read_pos % vchBuf.size()] == std::byte{ch}) { |
| 717 | break; |
| 718 | } |
| 719 | m_read_pos++; |
| 720 | } |
| 721 | } |
| 722 | }; |
| 723 | |
| 724 | #endif // BITCOIN_STREAMS_H |