mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 18:58:11 +00:00
`inScopeNamespaces()`, `namespaceDeclarations()` and `namespace()` walk from the node up to its root. The walk cloned each ancestor's whole node, children and attributes included, to read its namespaces, and charged fuel only for the namespaces it found, so a deep tree with no declared namespaces cost no fuel. It now takes one unit of fuel per ancestor, copies only the namespace list and parent link, and checks prefixes already seen with a set. `namespaceDeclarations()` compares the node's declarations with the ancestors' through a map instead of a scan.