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

Refactor if_exist validation with dot notation #5607

Merged

Conversation

paulbalandan
Copy link
Member

Description
Current logic uses array_reduce and iterates over the entire flattened data looking for matches. This PR refactors this by breaking early once it found a match, potentially improving resources over large arrays.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me if tests all pass.

@kenjis kenjis added the refactor Pull requests that refactor code label Jan 23, 2022
@paulbalandan paulbalandan merged commit 60e5347 into codeigniter4:develop Jan 23, 2022
@paulbalandan paulbalandan deleted the refactor-if-exist-dot-notation branch January 23, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Pull requests that refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants