findLogicalContainerCached method

InlineContainerNode? findLogicalContainerCached(
  1. String fragmentId
)

Returns the inline container node for fragmentId using the cached container-id + node index. O(1) on cache hit, O(n) on first lookup. Handlers should prefer this over findLogicalContainer(root, fragmentId).

Implementation

InlineContainerNode? findLogicalContainerCached(String fragmentId) {
  final containerId = findLogicalContainerId(fragmentId);
  if (containerId == null) return null;
  return nodeById(containerId) as InlineContainerNode?;
}