Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the input order when filtering #337

Merged
merged 1 commit into from Oct 23, 2023

Conversation

czechboy0
Copy link
Collaborator

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
8 checks passed
@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.

None yet

2 participants