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

cut: refactor #4255

Merged
merged 2 commits into from
Jan 27, 2023
Merged

cut: refactor #4255

merged 2 commits into from
Jan 27, 2023

Conversation

TechHara
Copy link
Contributor

@TechHara TechHara commented Jan 1, 2023

This PR refactors cut field logic to reduce code duplication by factoring out the common Searcer, which is templatized on a specific Matcher -- ExactMatcher for an explicit delimiter and WhitespaceMatcher for white-space delimiter.

before

  • code duplication in Searcher and WhitespaceSearcher
  • code duplication in cut_fields and cut_fields_whitespace

after

  • two versions of Matchers
  • one Searcher
  • simplify cut_fields by delegating actual work to specific functions

@github-actions
Copy link

github-actions bot commented Jan 1, 2023

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

GNU testsuite comparison:

GNU test failed: tests/misc/tee. tests/misc/tee is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/misc/sum is no longer failing!
GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

@sylvestre
Copy link
Sponsor Contributor

looks good, thanks

@sylvestre sylvestre merged commit 3ad36a4 into uutils:main Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants