Skip to content

Commit 78145ae

Browse files
authored
nit (#90)
Co-authored-by: Luke Videckis <lukevideckis@gmail.com>
1 parent 595a438 commit 78145ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/data_structures/seg_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ impl<T: Clone> SegTree<T> {
5353
/// # Complexity
5454
/// - Time: O(log n)
5555
/// - Space: O(1)
56-
pub fn set(&mut self, idx: usize, val: T) {
57-
let mut i = idx + self.n;
56+
pub fn set(&mut self, mut i: usize, val: T) {
57+
i += self.n;
5858
self.tree[i] = val;
5959
while i >= 2 {
6060
i /= 2;

0 commit comments

Comments
 (0)