-
Notifications
You must be signed in to change notification settings - Fork 107
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
Eliminate some o n2 #351
Merged
Merged
Eliminate some o n2 #351
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* editorconfig-core-handle.el: Change copyright to the FSF since all the contributors have signed the corresponding paperwork. (editorconfig-core-handle--parse-file): Directly return a `editorconfig-core-handle`; parse the buffer directly rather than matching on strings extracted from the buffer; avoid O(N²) complexity by constructing the lists in reverse and using `nreverse` at the end. (editorconfig-core-handle): Simplify accordingly. (editorconfig-core-handle--string-trim): Delete function, not used any more.
* editorconfig-fnmatch.el: Change copyright to the FSF since all the contributors have signed the corresponding paperwork. (editorconfig-fnmatch-p): Remove autoload cookie since all users do `require` anyway. (editorconfig-fnmatch--do-translate): Push in reverse order and `reverse` at the end to avoid the usual O(N²) complexity.
* editorconfig-fnmatch.el (editorconfig-fnmatch--do-translate): Consolidate the `push`s outside of `cl-case`. Use `regexp-opt`.
This fixes the failures I see in 155: semicolon_or_hash_in_property 156: backslashed_semicolon_or_hash_in_property 164: min_supported_key_length 165: min_supported_value_length * editorconfig-core-handle.el (editorconfig-core-handle--parse-file): Bump limits beyond the spec's minimum. * editorconfig-core.el (editorconfig-core-get-properties): Sort the result so it doesn't depend on arbitrary hash-table implementation choices.
There are some failures in the |
…into eliminate-some-O-n2 * editorconfig-core-handle.el (editorconfig-core-handle--parse-file): Remove the limits altogether.
I have now included an update to |
Thank you so much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This tries to improve a bit the code of
editorconfig-fnmatch
andeditorconfig-core-handle--parse-file
.