Commit fa5eeda
authored
feat: optimize repeatedScan for limit == 0 (#6015)
Problem Description:
In the original implementation, even after the limit had decreased to 0
in the previous splits, the iterator would still continue traversing
thousands of subsequent intervals. Although each interval only performed
the `is_some_and` check once, it still incurred unnecessary traversal
overhead.
Solution: This optimization immediately executes `break` when `limit ==
0` is detected, ensuring that subsequent intervals are no longer
traversed.
Signed-off-by: cancaicai <2356672992@qq.com>1 parent a30298b commit fa5eeda
1 file changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| |||
0 commit comments