(svn r19835) -Codechange: Extract grfident equality check to its own method.

This commit is contained in:
alberth
2010-05-16 18:50:37 +00:00
parent 39723ed247
commit 88fe11aae3
2 changed files with 13 additions and 5 deletions

View File

@@ -452,11 +452,7 @@ void ScanNewGRFFiles()
const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum)
{
for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) {
if (c->ident.grfid == grfid) {
if (md5sum == NULL) return c;
if (memcmp(md5sum, c->ident.md5sum, sizeof(c->ident.md5sum)) == 0) return c;
}
if (c->ident.HasGrfIdentifier(grfid, md5sum)) return c;
}
return NULL;