-
Notifications
You must be signed in to change notification settings - Fork 27
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
Used string comparisons ignoring case #226
base: master
Are you sure you want to change the base?
Changes from 2 commits
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 |
---|---|---|
|
@@ -65,6 +65,12 @@ public static void PutOriginalTargetBackIfNeeded(Int32 targetid) | |
} | ||
} | ||
} | ||
|
||
public static Boolean CompareInsensitive(this string str, string compareStr) | ||
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. change to EqualsIns , as its an equal operator and insensitive is a large word. Otherwise exactly what I meant 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. Wee, now I know how to make extensions in C# 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. or string.Eqic(user) 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. Happy to call it whatever, even string.RekkaEqic(user) :) |
||
{ | ||
return str.Equals(compareStr, StringComparison.OrdinalIgnoreCase); | ||
} | ||
|
||
public static string ReplaceInsensitive(this string str, | ||
string oldValue, string newValue) | ||
{ | ||
|
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.
forgot to do the spawn.DisplayName == E3.CurrentName types
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.
i just found all occurances of E3.CurrentName
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.
Also, have to remove the places where the first character is now upper cased as we are allowing anything to be in the config file and making it non case sensitive, so casting target will also have to use the new compairson i think
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.
thankfully TryByName in the spawns class is case insensitive already
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.
I left spawn.DisplayName == CurrentName, since I wasn't sure if we wanted to keep those case comparisons and that seemed intentional. It sounds like everything can be case insensitive then? Or are there cases we do care about case?
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.
other than using the containskey in said if staement
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.
I was just tracing usage of target for
so casting target will also have to use the new compairson i think
.So target should be fine, as getting/setting should be non case sensitive? At least in buffCheck
And
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.
if you read up in the comments, i already said trybyname was fine as it wasn't case sensitive :) its the other stuff tho
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.
basically anything with a == marks :P
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.
Oh, well then trybyname is fine :p. I was just trying to be exhaustive around other usages. Only things I saw was the
target = E3.CurrentName
,Spell.CastTarget = CharacterName
, ande3.firstCharToUpper
. But my traces seemed like they'd be okay?