mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 22:42:40 +00:00
This is a refactoring change with no output changes. The chunk logic already separates the concepts of "nodes with children" and "nodes with content" in practice, but it's not obvious in the API. This rewrites the logic to make the separation clearer. This also subtly takes advantage of the API to avoid creating lots of empty chunks... Right now, there's always an empty chunk between two tentative chunks. With this change, it lazily creates a chunk only when `out()` is used (which it often isn't), which should substantially reduce the number of chunks created.