Minor performance fix

This commit is contained in:
Nikolaj Olsson 2016-07-14 23:04:25 +02:00
parent f65eaad07d
commit bf60ea58f4
3 changed files with 3 additions and 3 deletions

View File

@ -796,7 +796,7 @@ namespace Nikse.SubtitleEdit.Core.BluRaySup
{
if (buffer.Length < 2)
return 0;
return (buffer[index + 1]) + (buffer[index + 0] << 8);
return buffer[index + 1] | (buffer[index] << 8);
}
private static uint BigEndianInt32(byte[] buffer, int index)

View File

@ -309,7 +309,7 @@ namespace Nikse.SubtitleEdit.Core.TransportStream
public static int GetEndianWord(byte[] buffer, int index)
{
if (index + 1 < buffer.Length)
return (buffer[index] << 8) + buffer[index + 1];
return (buffer[index] << 8) | buffer[index + 1];
return 0;
}

View File

@ -299,7 +299,7 @@ namespace Nikse.SubtitleEdit.Core.VobSub
public static int GetEndianWord(byte[] buffer, int index)
{
if (index + 1 < buffer.Length)
return (buffer[index] << 8) + buffer[index + 1];
return (buffer[index] << 8) | buffer[index + 1];
return 0;
}