We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ad439d commit c37757cCopy full SHA for c37757c
src/li_chao.rs
@@ -38,16 +38,16 @@ impl LiChaoTree {
38
return;
39
}
40
let ix = ((r - self.left + l - self.left) / 2) as usize;
41
- let x = self.left + (ix as i64);
+ let mid = self.left + (ix as i64);
42
let (ref mut m_ix, ref mut b_ix) = self.lines[ix];
43
- if m * x + b > *m_ix * x + *b_ix {
+ if m * mid + b > *m_ix * mid + *b_ix {
44
std::mem::swap(&mut m, m_ix);
45
std::mem::swap(&mut b, b_ix);
46
47
if m < self.lines[ix].0 {
48
- self.add_line_impl(m, b, l, x);
+ self.add_line_impl(m, b, l, mid);
49
} else {
50
- self.add_line_impl(m, b, x + 1, r);
+ self.add_line_impl(m, b, mid + 1, r);
51
52
53
0 commit comments