-
Notifications
You must be signed in to change notification settings - Fork 933
Various string manipulation optimizations #1543
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
3f6942b
e23bf84
14fde54
a6c9fec
6bfe359
83e7c17
85583b9
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 |
---|---|---|
|
@@ -404,6 +404,11 @@ public int IndexOfCaseInsensitive(string text) | |
return IndexOf(text, 0, _length, StringComparison.InvariantCultureIgnoreCase); | ||
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. It appears to me this one should be switched to But overall they are more than hundred cases were invariant is used in the code base. It looks to me most of them if not all should be switched to ordinal. Maybe worth a dedicated PR. (By the way if changing this case here, the 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.
Yeah. But it's public method. I'm afraid to change its behaviour :)
Agreed (but not as part of this PR) 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.
Fixing a behavior which is a bug is OK. I do not think the invariant behavior discrepancies with ordinal can be anything else than bugs for this case, but well, maybe I am wrong. Something that is equal with invariant but not equal with ordinal looks very likely to me to be considered not equal by the database query parser as well, in which case we would have a bug. Still this can be the subject of another PR, switching all invariant which should be to ordinal. I also think the change of most of them could be considered as also fixing bug possibilities. @hazzik, what is your view on this subject? Do you think it is ok to switch from invariant to ordinal in a minor release, considering it is also a bug fix, or would you rather have such change in a major release? |
||
} | ||
|
||
internal int IndexOfOrdinal(string text) | ||
{ | ||
return IndexOf(text, 0, _length, StringComparison.Ordinal); | ||
} | ||
|
||
/// <summary> | ||
/// Returns the index of the first occurrence of <paramref name="text" />, case-insensitive. | ||
/// </summary> | ||
|
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.
Actually I don't understand this code. Why "has dynamic filter param" is true when HqlVariablePrefix is missing?