Cleanup | Remove dead code paths and Regexes from SqlConnectionOptions - #4544
Open
edwardneal wants to merge 11 commits into
Open
Cleanup | Remove dead code paths and Regexes from SqlConnectionOptions#4544edwardneal wants to merge 11 commits into
edwardneal wants to merge 11 commits into
Conversation
ConnectionStringRegexOdbc was rendered unused by the previous commit.
This helper uses managed code rather than the the s_connectionStringValidKeyRegex Regex, but retains a Debug-only assertion.
These are now only used in debug builds
These are only used by netfx codepaths, and do not need to be instantiated on netcore
BraceQuoteValue and BraceQuoteValueQuote were only accessible from one another, and when useOdbcRules was true.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SqlConnectionOptionshas a handful of code paths which were inherited from the need to write a generic parser for ODBC connection strings. These code paths are no longer used, so this PR just cleans them up.In the case of
GetKeyValuePair, there are a few code paths which could never be called, and codecov demonstrates this. In the other cases, they were criteria which would always be met.One interesting point emerges from this:
SqlConnectionOptionshas four statically-initialised compiled Regex instances. One of them is completely unused, one is only used by netfx code and two are only used in Debug builds. I've cleaned these up, so the static constructor for the class sheds some load.This is cleanup work which has an incidental performance benefit - it doesn't have a benchmark attached to it, and I couldn't see any results because we're dealing with static constructors.
For review, this can move commit-by-commit.
Issues
None.
Testing
All unit tests for connection string parsing continue to pass. All changes can be statically verified.