mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-07 02:51:41 +00:00
A .fig message looked up each tag's field with a linear scan of its definition, so a wide schema and many tags cost their product. Schema decoding capped fields per definition but not in total, and inflated the schema chunk under the 512 MiB message cap. Empty non-byte arrays spent nothing from the decoded-value budget while still growing the output. Field ids (and enum values) are now found through a per-definition map built on first use, keeping first-match semantics. A schema holds at most 200 000 fields together and its chunk may inflate to 16 MiB. Every array field spends one value for itself before its elements.