MCPcopy Create free account
hub / github.com/ElementsProject/elements / ForEachNoDup

Function ForEachNoDup

src/test/util/str.h:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 */
31template <typename CharType, size_t StringLength, typename Fn>
32void 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

Callers 3

ForEachMergeSetupMethod · 0.85
ForEachMergeSetupMethod · 0.85
ForEachMergeSetupMethod · 0.85

Calls 2

NextStringFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected