| 790 | } |
| 791 | |
| 792 | fn contains(&self, descendant: NodeId, ancestor: NodeId) -> Option<bool> { |
| 793 | let d = self |
| 794 | .ranks |
| 795 | .binary_search_by_key(&descendant.get(), |(id, _)| id.get()) |
| 796 | .ok()?; |
| 797 | let a = self |
| 798 | .ranks |
| 799 | .binary_search_by_key(&ancestor.get(), |(id, _)| id.get()) |
| 800 | .ok()?; |
| 801 | if descendant == ancestor { |
| 802 | return Some(false); |
| 803 | } |
| 804 | let (d, a) = (self.ranks[d].1, self.ranks[a].1); |
| 805 | Some(self.bits[d * self.words + a / 64] & (1u64 << (a % 64)) != 0) |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | /// Validated span content shared by file renders in one read transaction. |