mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Minor performance fix
This commit is contained in:
parent
f65eaad07d
commit
bf60ea58f4
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user