-
Notifications
You must be signed in to change notification settings - Fork 286
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
Perf: Stop creating parameter prefixed names #1829
Conversation
Codecov ReportBase: 71.41% // Head: 71.39% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1829 +/- ##
==========================================
- Coverage 71.41% 71.39% -0.02%
==========================================
Files 290 291 +1
Lines 61280 61362 +82
==========================================
+ Hits 43761 43811 +50
- Misses 17519 17551 +32
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@@ -5995,11 +5999,11 @@ private SqlParameter BuildStoredProcedureStatementForColumnEncryption(string sto | |||
|
|||
// Find the return value parameter (if any). | |||
SqlParameter returnValueParameter = null; | |||
foreach (SqlParameter parameter in parameters) |
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.
Why not keep the full name?
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.
Because a variable with that name is created and used later in this scope. I don't want to explicitly re-use the same variable because it can leave opportunity for errors to creep in with casual refactorings in future. So I renamed the foreach version because it has the lower number of uses. Same with the other one you noted below.
{ | ||
returnValueParameter = parameter; | ||
returnValueParameter = param; |
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.
Why not keep the full name?
This is green and approved. Can I get it merged before other change start causing conflicts please? |
A fairly straight forward set of changes to avoid creating @ prefixed parameter names unless we need the string, for example in an error message. Most of the time we can either do a comparison that takes into account the prefixed and unprefixed possibilities or we can append the @ and then the parameter name if we just check what we already have.
Note that this does not change the parameter name that the user provides and will have no visible change as far as users are concerned. We're just being a little more careful about generating gen0 strings that are going to be thrown away.