Rafact (minor) + typo

This commit is contained in:
niksedk 2019-08-22 12:59:58 +02:00
parent d299848cdc
commit 267e61b9a5
2 changed files with 11 additions and 12 deletions

View File

@ -19,7 +19,7 @@ namespace Nikse.SubtitleEdit.Core.Translate
var text = input.Trim();
// SSA/ASS tags
if (text.StartsWith("{\\"))
if (text.StartsWith("{\\", StringComparison.Ordinal))
{
var endIndex = text.IndexOf('}');
if (endIndex > 0)

View File

@ -125,10 +125,10 @@ namespace Nikse.SubtitleEdit.Core.Translate
if (resultList.Count > paragraphs.Count)
{
var timmedList = resultList.Where(p => !string.IsNullOrEmpty(p)).ToList();
if (timmedList.Count == paragraphs.Count)
var trimmedList = resultList.Where(p => !string.IsNullOrEmpty(p)).ToList();
if (trimmedList.Count == paragraphs.Count)
{
return timmedList;
return trimmedList;
}
}
@ -153,12 +153,12 @@ namespace Nikse.SubtitleEdit.Core.Translate
var line = input[index];
var text = paragraphs[index].Text;
var badPoints = 0;
if (text.StartsWith("[") && !line.StartsWith("["))
if (text.StartsWith('[') && !line.StartsWith('['))
{
badPoints++;
}
if (text.StartsWith("-") && !line.StartsWith("-"))
if (text.StartsWith('-') && !line.StartsWith('-'))
{
badPoints++;
}
@ -168,27 +168,27 @@ namespace Nikse.SubtitleEdit.Core.Translate
badPoints++;
}
if (text.EndsWith(".") && !line.EndsWith("."))
if (text.EndsWith('.') && !line.EndsWith('.'))
{
badPoints++;
}
if (text.EndsWith("!") && !line.EndsWith("!"))
if (text.EndsWith('!') && !line.EndsWith('!'))
{
badPoints++;
}
if (text.EndsWith("?") && !line.EndsWith("?"))
if (text.EndsWith('?') && !line.EndsWith('?'))
{
badPoints++;
}
if (text.EndsWith(",") && !line.EndsWith(","))
if (text.EndsWith(',') && !line.EndsWith(','))
{
badPoints++;
}
if (text.EndsWith(":") && !line.EndsWith(":"))
if (text.EndsWith(':') && !line.EndsWith(':'))
{
badPoints++;
}
@ -222,6 +222,5 @@ namespace Nikse.SubtitleEdit.Core.Translate
return input;
}
}
}