| 30 | */ |
| 31 | template <typename CharType, size_t StringLength, typename Fn> |
| 32 | void ForEachNoDup(CharType (&string)[StringLength], CharType min_char, CharType max_char, Fn&& fn) { |
| 33 | for (bool has_next = true; has_next; has_next = NextString(string, min_char, max_char)) { |
| 34 | int prev = -1; |
| 35 | bool skip_string = false; |
| 36 | for (CharType c : string) { |
| 37 | if (c == prev) skip_string = true; |
| 38 | if (skip_string || c < min_char || c > max_char) break; |
| 39 | prev = c; |
| 40 | } |
| 41 | if (!skip_string) fn(); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | #endif // BITCOIN_TEST_UTIL_STR_H |
no test coverage detected