diff options
author | Marius Ungureanu <teromario@yahoo.com> | 2017-02-16 15:09:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-16 15:09:34 +0300 |
commit | 9b3cd898a4336a196d2123930b2375b364da6c7d (patch) | |
tree | 0ab5875757dfae7477e98ecadfc4fd579cf76cf4 /main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs | |
parent | 642cfa4ca9708564f34f27f441710cde27bb3abc (diff) |
String optimizations (#1881)
* [Core] Remove ToLower where applicable.
* [Core] Remove ToUpper where applicable.
* [View] Fix possible crash in no selection tolower/toupper
Instead of getting just 1 char, we get a possible huge string, depending on the caret's offset in a document.
* [Ide] Fix lots of intermediate strings being created on keybindings panel filtering
* [Ide] Remove string.ToLower where applicable.
* [Ide] Remove string.ToUpper where applicable.
* [Editor] Remove string.ToLower where applicable.
* [Addins] Remove string.ToLower string.ToUpper where applicable.
Diffstat (limited to 'main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs')
-rw-r--r-- | main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs index 46924c50e8..8907f4414a 100644 --- a/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs +++ b/main/src/addins/MonoDevelop.Gettext/MonoDevelop.Gettext.Editor/POEditorWidget.cs @@ -752,9 +752,7 @@ namespace MonoDevelop.Gettext if (RegexSearch) return regex.IsMatch (text); - if (!IsCaseSensitive) - text = text.ToUpper (); - int idx = text.IndexOf (filter); + int idx = text.IndexOf (filter, IsCaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); if (idx >= 0) { if (IsWholeWordOnly) { return (idx == 0 || char.IsWhiteSpace (text[idx - 1])) && @@ -804,8 +802,6 @@ namespace MonoDevelop.Gettext void UpdateFromCatalog () { filter = this.searchEntryFilter.Entry.Text; - if (!IsCaseSensitive && filter != null) - filter = filter.ToUpper (); if (RegexSearch) { try { RegexOptions options = RegexOptions.Compiled; |