Small optimization to func/var import.

Should compare the nid first, of course, faster and less likely to match
anyway.
This commit is contained in:
Unknown W. Brackets 2014-11-02 17:53:46 -08:00
parent 2d5733407b
commit a391296c17

View File

@ -114,7 +114,7 @@ struct VarSymbolImport {
struct VarSymbolExport {
bool Matches(const VarSymbolImport &other) const {
return !strncmp(moduleName, other.moduleName, KERNELOBJECT_MAX_NAME_LENGTH) && nid == other.nid;
return nid == other.nid && !strncmp(moduleName, other.moduleName, KERNELOBJECT_MAX_NAME_LENGTH);
}
char moduleName[KERNELOBJECT_MAX_NAME_LENGTH + 1];
@ -130,7 +130,7 @@ struct FuncSymbolImport {
struct FuncSymbolExport {
bool Matches(const FuncSymbolImport &other) const {
return !strncmp(moduleName, other.moduleName, KERNELOBJECT_MAX_NAME_LENGTH) && nid == other.nid;
return nid == other.nid && !strncmp(moduleName, other.moduleName, KERNELOBJECT_MAX_NAME_LENGTH);
}
char moduleName[KERNELOBJECT_MAX_NAME_LENGTH + 1];