dir: Minor optimization to find_used_ref()

Its commonly the case that a runtime lists itself as its runtime and/or sdk.
So, short circuit this in the finding of used refs.
This commit is contained in:
Alexander Larsson
2020-11-14 13:47:48 +01:00
committed by Alexander Larsson
parent 8f07945e57
commit 39333fdb33

View File

@@ -15755,7 +15755,7 @@ find_used_refs (FlatpakDir *self,
if (runtime)
{
g_autoptr(FlatpakDecomposed) runtime_ref = flatpak_decomposed_new_from_pref (FLATPAK_KINDS_RUNTIME, runtime, NULL);
if (runtime_ref)
if (runtime_ref && !flatpak_decomposed_equal (runtime_ref, ref_to_analyze))
queue_ref_for_analysis (runtime_ref, arch, analyzed_refs, refs_to_analyze);
}
}
@@ -15765,7 +15765,7 @@ find_used_refs (FlatpakDir *self,
if (sdk)
{
g_autoptr(FlatpakDecomposed) sdk_ref = flatpak_decomposed_new_from_pref (FLATPAK_KINDS_RUNTIME, sdk, NULL);
if (sdk_ref)
if (sdk_ref && !flatpak_decomposed_equal (sdk_ref, ref_to_analyze))
queue_ref_for_analysis (sdk_ref, arch, analyzed_refs, refs_to_analyze);
}