From 17d91c270157d35ee41470f831804546c899f741 Mon Sep 17 00:00:00 2001 From: zihang Date: Thu, 28 Nov 2024 18:33:16 +0800 Subject: [PATCH] fix: update code --- next/sources/segment-tree/src/part2/top.mbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/next/sources/segment-tree/src/part2/top.mbt b/next/sources/segment-tree/src/part2/top.mbt index 837e8f03..cceeea2a 100644 --- a/next/sources/segment-tree/src/part2/top.mbt +++ b/next/sources/segment-tree/src/part2/top.mbt @@ -112,7 +112,9 @@ fn modify( self.apply(tag) } else { guard let Node(left~, right~, ..) = self - left.apply(tag) + right.apply(tag) + let mid = (l + r) >> 1 + left.modify(l, mid, modify_l, modify_r, tag) + + right.modify(mid + 1, r, modify_l, modify_r, tag) } } // end modify definition