FileTypes: Avoid useless call to ReplaceRef
Don't replace the ref with itself in the most common case where the scanned file is not a symlink. Save a lot of useless memory copies and ref flattening in BMessage.
This commit is contained in:
parent
a6f1bc984d
commit
234ac3f191
@ -238,7 +238,8 @@ FileTypes::RefsReceived(BMessage* message)
|
||||
}
|
||||
|
||||
if (!is_application(file) && !is_resource(file)) {
|
||||
if (entry.GetRef(&ref) == B_OK)
|
||||
entry_ref target;
|
||||
if (entry.GetRef(&target) == B_OK && target != ref)
|
||||
message->ReplaceRef("refs", index - 1, &ref);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user