git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1953 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2008-03-25 00:45:43 +00:00
parent eb7094d49e
commit 33e856345f
16 changed files with 126 additions and 179 deletions

View File

@@ -39,13 +39,11 @@ namespace OpenRa.FileFormats
MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(name));
BinaryReader reader = new BinaryReader(ms);
int len = name.Length >> 2;
uint result = 0;
try
{
while(true)
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
}
catch (EndOfStreamException) { }
while (len-- != 0)
result = ((result << 1) | (result >> 31)) + reader.ReadUInt32();
return result;
}