Skip to content

Conversation

martincostello
Copy link
Contributor

Fixes some issues I found while working on #2459.

  • Add missing entry to .resx file.
  • Regenerate resource designer code in Visual Studio to remove redundant properties.
  • Fix the namespace the resource designer generates with.
  • Use TryGetValue() and Count/Length to improve performance.
  • Fix typo in test name.
  • Sort usings.

- Add missing entry.
- Regenerate designer code to remove redundant properties.
- Fix the namespace the resource designer generates with.
- Use `TryGetValue()` and `Count`/`Length` to improve performance.
- Fix typo in test name.
- Sort usings.
@Copilot Copilot AI review requested due to automatic review settings August 8, 2025 13:32
@martincostello martincostello requested a review from a team as a code owner August 8, 2025 13:32
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 PR addresses various code quality improvements and fixes discovered while working on issue #2459, focusing on performance optimizations, typo corrections, and resource file maintenance.

  • Fixes typo in test method name from "RemoveValidatioRule" to "RemoveValidationRule"
  • Improves performance by replacing LINQ .Any() calls with more efficient .Count > 0 and .Length != 0 checks
  • Optimizes dictionary operations using TryGetValue() to avoid multiple key lookups

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
test/Microsoft.OpenApi.Tests/Validations/ValidationRuleSetTests.cs Fixes typo in test name and replaces .Any() with .Count > 0 and .Length != 0 for performance
src/Microsoft.OpenApi/Validations/ValidationRuleSet.cs Sorts using statements and optimizes dictionary operations with TryGetValue() and .Count > 0
src/Microsoft.OpenApi/Properties/SRResource.resx Adds missing "ArgumentNull" resource entry
src/Microsoft.OpenApi/Microsoft.OpenApi.csproj Adds CustomToolNamespace for resource file generation
Files not reviewed (1)
  • src/Microsoft.OpenApi/Properties/SRResource.Designer.cs: Language not supported

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@baywet baywet enabled auto-merge August 15, 2025 12:21
@baywet baywet merged commit c0b7adc into microsoft:main Aug 15, 2025
9 checks passed
@martincostello martincostello deleted the code-fixes branch August 15, 2025 12:29
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