Skip to content

Commit 2166a3d

Browse files
authored
Refactor update method for lazy segment tree
1 parent e2cdebb commit 2166a3d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/data_structures_[l,r)/lazy_seg_tree.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ struct seg_tree {
2727
}
2828
void update(int l, int r, ll d, int tl, int tr, int v) {
2929
if (r <= tl || tr <= l) return;
30-
if (l <= tl && tr <= r)
31-
return apply(d, tl, tr, v);
30+
if (l <= tl && tr <= r) return apply(d, tl, tr, v);
3231
int tm = split(tl, tr);
3332
push(tl, tm, tr, v);
3433
update(l, r, d, tl, tm, 2 * v);

0 commit comments

Comments
 (0)