Skip to content

Conversation

fiseni
Copy link
Collaborator

@fiseni fiseni commented Aug 23, 2025

Fixes #528

@fiseni fiseni requested a review from Copilot August 23, 2025 11:33
Copy link

@Copilot 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 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.

@fiseni fiseni merged commit 6774939 into main Aug 23, 2025
1 check passed
@fiseni fiseni deleted the fallback-code-allocations branch August 23, 2025 11:35
This was referenced Aug 25, 2025
gritcsenko added a commit to gritcsenko/HomeInventory that referenced this pull request Aug 26, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
|
[Ardalis.Specification](https://redirect.github.com/ardalis/specification)
| `9.3.0` -> `9.3.1` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/Ardalis.Specification/9.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/Ardalis.Specification/9.3.0/9.3.1?slim=true)](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
[@&#8203;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
[@&#8203;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==-->
This was referenced Oct 16, 2025
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.

Fix allocations of an unreachable fallback code

1 participant