mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 20:52:44 +01:00
Optimize RemoveChar a little
This commit is contained in:
parent
4ddd60c3bd
commit
3ec673c5a6
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.Common
|
||||
@ -471,12 +470,13 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
|
||||
public static string RemoveChar(this string value, params char[] charsToRemove)
|
||||
{
|
||||
var h = new HashSet<char>(charsToRemove);
|
||||
char[] array = new char[value.Length];
|
||||
int arrayIndex = 0;
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
char ch = value[i];
|
||||
if (!charsToRemove.Contains(ch))
|
||||
if (!h.Contains(ch))
|
||||
{
|
||||
array[arrayIndex++] = ch;
|
||||
}
|
||||
|
@ -15603,7 +15603,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
else if (e.KeyCode == Keys.A && e.Modifiers == (Keys.Control | Keys.Alt | Keys.Shift))
|
||||
else if (e.KeyCode == Keys.A && e.Modifiers == (Keys.Control | Keys.Alt | Keys.Shift))
|
||||
{
|
||||
if (GetCurrentSubtitleFormat().GetType() == typeof(AdvancedSubStationAlpha))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user