-
Notifications
You must be signed in to change notification settings - Fork 934
Optimize usages of SqlString.Append #2166
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
Changes from all commits
1dd2d1a
291a05b
df06643
361aafc
f026d16
7f8b2d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,7 +347,23 @@ public SqlString Append(string text) | |
{ | ||
if (string.IsNullOrEmpty(text)) return this; | ||
if (_length == 0) return new SqlString(text); | ||
return new SqlString(new object[] { this, text }); | ||
return new SqlString(this, text); | ||
} | ||
|
||
public SqlString Append(params object[] parts) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would consider introducing a new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I've considered such ctor. But looking at existing ctors |
||
{ | ||
return _length == 0 | ||
? new SqlString(parts) | ||
: new SqlString(GetAppendParts(parts)); | ||
} | ||
|
||
private IEnumerable<object> GetAppendParts(object[] parts) | ||
{ | ||
yield return this; | ||
foreach (var part in parts) | ||
{ | ||
yield return part; | ||
} | ||
} | ||
|
||
/// <summary> | ||
|
Uh oh!
There was an error while loading. Please reload this page.