Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(tui): use stable viewport bit scan

Steven Enamakel8e3a684f3aef
diff --git a/crates/openhuman-tui/src/viewport.rs b/crates/openhuman-tui/src/viewport.rs
index 716e9b8321..6a1f09f983 100644
--- a/crates/openhuman-tui/src/viewport.rs
+++ b/crates/openhuman-tui/src/viewport.rs
@@ -48,7 +48,7 @@ impl HeightIndex {
}
fn push(&mut self, height: usize) {
let index = self.tree.len() + 1;
- let start = index - index.isolate_lowest_one();
+ let start = index - (index & index.wrapping_neg());
self.tree.push(height + self.total - self.prefix(start));
self.total += height;
}
@@ -57,7 +57,7 @@ impl HeightIndex {
let mut index = index + 1;
while index <= self.tree.len() {
self.tree[index - 1] = self.tree[index - 1] - before + after;
- index += index.isolate_lowest_one();
+ index += (index & index.wrapping_neg());
}
}
fn containing(&self, row: usize) -> usize {