-
Notifications
You must be signed in to change notification settings - Fork 255
Fix allocations produced by unreachable fallback code #529
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
Conversation
There was a problem hiding this 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 pull request fixes issue #528 by restructuring fallback code paths in various evaluator and validator classes to prevent unnecessary allocations when the fallback code is unreachable. The changes ensure that when optimized paths are taken, the fallback logic is properly isolated and won't cause memory allocations.
- Restructured conditional logic to isolate fallback code paths and prevent allocations
- Extracted fallback methods as static local functions in search-related classes
- Fixed unreachable code patterns across multiple evaluator and validator implementations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
WhereValidator.cs | Restructured validation logic to prevent unreachable fallback allocations |
SearchValidator.cs | Extracted fallback logic into static local function |
WhereEvaluator.cs | Fixed unreachable fallback code in query evaluation methods |
SearchMemoryEvaluator.cs | Extracted fallback logic into static local function |
QueryTagEvaluator.cs | Restructured query tagging logic to prevent unreachable allocations |
IncludeStringEvaluator.cs | Fixed unreachable fallback code in include string evaluation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [Ardalis.Specification](https://redirect.github.com/ardalis/specification) | `9.3.0` -> `9.3.1` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ardalis/specification (Ardalis.Specification)</summary> ### [`v9.3.1`](https://redirect.github.com/ardalis/Specification/releases/tag/v9.3.1) #### What's Changed - Fix allocations produced by unreachable fallback code by [@​fiseni](https://redirect.github.com/fiseni) in [ardalis/Specification#529](https://redirect.github.com/ardalis/Specification/pull/529) - Use NSubstitute for testing custom spec implementations. by [@​fiseni](https://redirect.github.com/fiseni) in [ardalis/Specification#530](https://redirect.github.com/ardalis/Specification/pull/530) **Full Changelog**: <ardalis/Specification@v9.3.0...v9.3.1> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/gritcsenko/HomeInventory). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi43IiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Fixes #528