Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@orgads
Copy link
Contributor

@orgads orgads commented Oct 5, 2025

when arrayFilters is not set.

when arrayFilters is not set.
@orgads orgads force-pushed the perf-array-filters branch from 4079000 to d4c921d Compare October 5, 2025 05:11
@orgads
Copy link
Contributor Author

orgads commented Oct 5, 2025

@vkarpov15

@vkarpov15 vkarpov15 requested a review from Copilot October 6, 2025 17:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the castArrayFilters function by moving the array validation check to occur earlier in the execution flow. The change prevents unnecessary computations when arrayFilters is not set or not an array.

  • Moved the Array.isArray(arrayFilters) check from the _castArrayFilters helper function to the main castArrayFilters function
  • This avoids calling query.getUpdate(), updatedPathsByArrayFilter(), and other operations when array filters are not present

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@vkarpov15 vkarpov15 added this to the 8.19.1 milestone Oct 6, 2025
@vkarpov15 vkarpov15 merged commit d030c29 into Automattic:master Oct 6, 2025
38 checks passed
@orgads orgads deleted the perf-array-filters branch October 7, 2025 20:19
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