(
found: GraphNode<NodeId>,
pos: Position<NodeId>,
is_predecessor: bool,
)
| 281 | /// logic has a single definition. |
| 282 | #[inline] |
| 283 | pub(crate) fn adjust_for_mid_span( |
| 284 | found: GraphNode<NodeId>, |
| 285 | pos: Position<NodeId>, |
| 286 | is_predecessor: bool, |
| 287 | ) -> GraphNode<NodeId> { |
| 288 | if is_predecessor { |
| 289 | // Predecessor: return the portion up to `pos` |
| 290 | if found.end > pos.pos && found.start < pos.pos { |
| 291 | GraphNode { |
| 292 | change: found.change, |
| 293 | start: found.start, |
| 294 | end: pos.pos, |
| 295 | } |
| 296 | } else { |
| 297 | found |
| 298 | } |
| 299 | } else { |
| 300 | // Successor: return the portion from `pos` onward |
| 301 | if found.start < pos.pos && found.end > pos.pos { |
| 302 | GraphNode { |
| 303 | change: found.change, |
| 304 | start: pos.pos, |
| 305 | end: found.end, |
| 306 | } |
| 307 | } else { |
| 308 | found |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // Tests |
| 314 |
no outgoing calls
no test coverage detected