Skip to content

Conversation

@czechboy0
Copy link
Contributor

Motivation

The original implementation of document filtering iterated over a Set and a Dictionary, which do not guarantee a stable order, meaning that every time the filter command was invoked with identical inptus, it could produce different outputs, potentially leading to needless rebuilds when used as a plugin, and needless commits when using ahead-of-time generation. It also made debugging of the generator itself more difficult.

Modifications

Respect the input order of operations and components.

Result

Invoking the generator multiple times with the same input produces the same output every time, improving cachability.

Test Plan

Renamed the filter test to be consistent with the rest and manually tested on a larger document.

@czechboy0 czechboy0 merged commit 4ebe476 into apple:main Oct 23, 2023
@czechboy0 czechboy0 deleted the hd-filter-stable-order branch October 23, 2023 11:59
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants