Skip to content

avoid tostring in SqlConnectionEncryptOptionConverter if we know value is a string#4012

Merged
cheenamalhotra merged 1 commit into
dotnet:mainfrom
SimonCropp:avoid-tostring-in-SqlConnectionEncryptOptionConverter-if-we-know-value-is-a-string
Apr 8, 2026
Merged

avoid tostring in SqlConnectionEncryptOptionConverter if we know value is a string#4012
cheenamalhotra merged 1 commit into
dotnet:mainfrom
SimonCropp:avoid-tostring-in-SqlConnectionEncryptOptionConverter-if-we-know-value-is-a-string

Conversation

@SimonCropp
Copy link
Copy Markdown
Contributor

No description provided.

@SimonCropp SimonCropp requested a review from a team as a code owner March 6, 2026 13:22
Copilot AI review requested due to automatic review settings March 6, 2026 13:22
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Mar 6, 2026
Copy link
Copy Markdown
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 makes a minor performance improvement in SqlConnectionEncryptOptionConverter.ConvertFrom by using C# pattern matching (value is string s) to avoid an unnecessary ToString() call on an object already known to be a string.

Changes:

  • Replace value is string type check + value.ToString() with value is string s pattern match to directly use the captured string variable.

@paulmedynski paulmedynski added the Code Health 💊 Issues/PRs that are targeted to source code quality improvements. label Mar 9, 2026
@paulmedynski paulmedynski modified the milestones: 7.0.1, 7.1.0-preview1 Mar 9, 2026
@benrr101 benrr101 moved this from To triage to In review in SqlClient Board Mar 17, 2026
@mdaigle
Copy link
Copy Markdown
Contributor

mdaigle commented Mar 26, 2026

/azp run

@paulmedynski paulmedynski self-assigned this Apr 7, 2026
@paulmedynski
Copy link
Copy Markdown
Contributor

/azp run

@paulmedynski paulmedynski modified the milestone: 7.1.0-preview1 Apr 7, 2026
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@cheenamalhotra cheenamalhotra enabled auto-merge (squash) April 8, 2026 01:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.34%. Comparing base (569ada7) to head (0c07a1f).
⚠️ Report is 61 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (569ada7) and HEAD (0c07a1f). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (569ada7) HEAD (0c07a1f)
CI-SqlClient 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4012      +/-   ##
==========================================
- Coverage   72.36%   66.34%   -6.02%     
==========================================
  Files         287      274      -13     
  Lines       43149    65785   +22636     
==========================================
+ Hits        31223    43646   +12423     
- Misses      11926    22139   +10213     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 66.34% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheenamalhotra cheenamalhotra merged commit 52c7149 into dotnet:main Apr 8, 2026
302 of 304 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in SqlClient Board Apr 8, 2026
@SimonCropp SimonCropp deleted the avoid-tostring-in-SqlConnectionEncryptOptionConverter-if-we-know-value-is-a-string branch April 8, 2026 04:03
paulmedynski pushed a commit that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Health 💊 Issues/PRs that are targeted to source code quality improvements.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants