1 - Use getOrPut to avoid making 2 map lookups where possible.
2 - Use an arena allocator for Values, which makes memory management simpler.
3 - Because of #2, we no longer need to allocate key or values which don't need
to be unescaped. The downside is that the input string has to outlive the
query.Values (but I think this is currently always the case)
4 - Optimize unescape logic & allocations
5 - Improve test coverage
Common cases, text/html, text/xml and text/plain parse about 2x faster. Other
cases are about 30% faster.
Support quoted attributes, i.e. charset="utf-8" & valid escape sequences. This
potentially requires allocation, thus Mime.parse now takes an allocator.
Stricter validation around type/subtype based on RFC.
More tests.
Replace Mime.eql with isHTML(). Equality is complicated and was previously
incorrect (it was case sensitive, it should not be). Since we currently only
use isHTML-like behavior, built a (faster) method specifically for that.
1- Remove `parser.trim`, it was only being used in 1 place. All other places
are using `std.mem.trim(u8, X, &std.ascii.whitespace)`, so i updated MIME to
use this as well
2- Use slightly more meaningful field name, i => pos, s = data
3- Leverage std.mem.indexOfScalarPos which can be more efficient for longer
inputs (since it leverages SIMD)