A required unmatched key cannot occur in the other closed map, even when
the remaining unmatched keys include optional fields. Recognize this
case early to avoid retaining unnecessary BDD nodes during subtraction.
Assisted-by: Codex:GPT-6
Branching on the step sign rather than `first_days <= last_days` eliminates
the need for `empty?/1` because the interval bounding checks inherently
guarantee non-emptiness. This aligns `Enumerable.Date.Range` with
`Enumerable.Range`, eliminates a private function call per membership
check, and removes 27 lines of redundant code.
Assisted-by: Antigravity:Gemini-3.7-Flash
Do not refine both operands from the result expectation because either operand may be discarded by term ordering. Apply the expectation only to the result and cover escaping operand bindings.
Assisted-by: Codex:GPT-5
Match OTP's stacktrace contract in __STACKTRACE__ inference and the :erlang.raise/3 signature, allowing arbitrary keyword metadata.
Assisted-by: Codex:GPT-5.6
Both encoders were built on a binary comprehension whose body calls
`percent/2` through a captured predicate:
for <<byte <- string>>, into: "" do
case percent(byte, &char_unreserved?/1) do
"%20" -> "+"
percent -> percent
end
end
`for ... into: ""` over a binary generator compiles to a native Erlang
bitstring comprehension, so the comprehension itself is fine, but in the
body it pays per byte a `make_fun3` to build the captured predicate, a
call to `percent/2` plus an indirect call through it, a freshly
allocated one- or three-byte binary that is discarded immediately, an
`is_eq_exact` against the literal "%20", and a runtime-sized
`bs_create_bin` to append the result.
Rewrite it as a tail-recursive loop that writes the escape straight into
the accumulator. The unreserved test moves into a `defguardp` so it
inlines instead of going through a closure, `+` is handled by its own
clause rather than by comparing the produced binary against "%20", and
the appended segments have compile-time-known sizes.
Apply the leading duration sign as components are parsed, avoiding a second pass for negative durations.
Track allowed date and time units with ordered positions instead of keyword-list tails and recursive lookups.
Assisted-by: Codex:GPT-5