mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 15:02:35 +01:00
"Relocate culture evaluation logic in StringExtensions
The culture type evaluation logic was moved to a more suitable location in the code within the StringExtensions file. This change ensures that the culture type is assessed only when it's necessary, avoiding unnecessary operations and leading to optimized performance."
This commit is contained in:
parent
b27dc60631
commit
adc8fe703e
@ -789,9 +789,6 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
return false;
|
||||
}
|
||||
|
||||
// evaluate culture type
|
||||
var isCultureNeutral = twoLetterLanguageCode?.Equals("el", StringComparison.OrdinalIgnoreCase) == false;
|
||||
|
||||
// handles when sentence ending char is adjacent with html closing tags e.g: </i>, </font>...
|
||||
if (value[checkIndex] == '>')
|
||||
{
|
||||
@ -820,6 +817,8 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
return checkIndex > 0 && char.IsLetter(value[checkIndex - 1]);
|
||||
}
|
||||
|
||||
// evaluate culture type
|
||||
var isCultureNeutral = twoLetterLanguageCode?.Equals("el", StringComparison.OrdinalIgnoreCase) == false;
|
||||
return NeutralSentenceEndingChars.Contains(charAtIndex) || (!isCultureNeutral && GreekSentenceEndingChars.Contains(charAtIndex));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user