Skip to content

Commit 6716469

Browse files
committed
Split assert conditions
To be easy to distinguish which predicate is failed.
1 parent 009906b commit 6716469

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/cpalgo/util/binary_search.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ inline int64_t binary_search(
2121
int64_t ng,
2222
int64_t ok
2323
) {
24-
assert(!predicate(ng) && predicate(ok));
24+
assert(!predicate(ng));
25+
assert(predicate(ok));
2526
while (abs(ok - ng) > 1) {
2627
auto m = (ok + ng) / 2;
2728
if (predicate(m)) ok = m;

0 commit comments

Comments
 (0)