| 614 | } |
| 615 | |
| 616 | fn contains(&self, descendant: NodeId, ancestor: NodeId) -> Option<bool> { |
| 617 | let d = self |
| 618 | .ranks |
| 619 | .binary_search_by_key(&descendant.get(), |(id, _)| id.get()) |
| 620 | .ok()?; |
| 621 | let a = self |
| 622 | .ranks |
| 623 | .binary_search_by_key(&ancestor.get(), |(id, _)| id.get()) |
| 624 | .ok()?; |
| 625 | if descendant == ancestor { |
| 626 | return Some(false); |
| 627 | } |
| 628 | let (d, a) = (self.ranks[d].1, self.ranks[a].1); |
| 629 | Some(self.bits[d * self.words + a / 64] & (1u64 << (a % 64)) != 0) |
| 630 | } |
| 631 | } |
| 632 | |
| 633 | /// Validated span content shared by file renders in one read transaction. |