Find first index >= start_index where predicate is True.
(self, predicate: Callable[[T], bool], start_index: int = 0)
| 105 | return self.operation(left_result, right_result) |
| 106 | |
| 107 | def find_first(self, predicate: Callable[[T], bool], start_index: int = 0) -> int: |
| 108 | """Find first index >= start_index where predicate is True.""" |
| 109 | if start_index >= self.size: |
| 110 | return -1 |
| 111 | return self._find_first(1, 0, self.tree_size - 1, predicate, start_index) |
| 112 | |
| 113 | def _find_first( |
| 114 | self, node: int, start: int, end: int, predicate: Callable[[T], bool], search_start: int |