mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-19 07:17:00 +00:00
Do not apply diff filters sub-tree not carrying changes
Some *huge* sub-trees might not carry any change. In that case do not bother applying the filter because eventually no filter is going to be applied anyway. This can save us a lot of walking time. * src/abg-comp-filter.cc ({harmless, harmful}_filter::visit): Do not try to do the categorizing on a diff sub-tree that does not carry any change. * src/abg-comparison.cc (diff_context::maybe_apply_filters): Do not bother trying to apply the filters on a diff sub-tree that does not carry any change. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
parent
8b28d171c3
commit
ba8ecf46a1
@ -670,6 +670,9 @@ has_harmful_enum_change(const diff* diff)
|
||||
bool
|
||||
harmless_filter::visit(diff* d, bool pre)
|
||||
{
|
||||
if (!d->has_changes())
|
||||
return true;
|
||||
|
||||
diff_category category = NO_CHANGE_CATEGORY;
|
||||
|
||||
if (pre)
|
||||
@ -721,6 +724,9 @@ harmful_filter::visit(diff* d, bool pre)
|
||||
{
|
||||
diff_category category = NO_CHANGE_CATEGORY;
|
||||
|
||||
if (!d->has_changes())
|
||||
return true;
|
||||
|
||||
if (pre)
|
||||
{
|
||||
decl_base_sptr f = d->first_subject(),
|
||||
|
@ -2710,6 +2710,9 @@ diff_context::maybe_apply_filters(diff_sptr diff,
|
||||
if (get_allowed_category() == EVERYTHING_CATEGORY)
|
||||
return;
|
||||
|
||||
if (!diff->has_changes())
|
||||
return;
|
||||
|
||||
bool s = visiting_a_node_twice_is_forbidden();
|
||||
if (!visit_nodes_once)
|
||||
forbid_visiting_a_node_twice(false);
|
||||
@ -2738,6 +2741,10 @@ void
|
||||
diff_context::maybe_apply_filters(corpus_diff_sptr diff,
|
||||
bool visit_nodes_once)
|
||||
{
|
||||
|
||||
if (!diff || !diff->has_changes())
|
||||
return;
|
||||
|
||||
bool s = visiting_a_node_twice_is_forbidden();
|
||||
if (!visit_nodes_once)
|
||||
forbid_visiting_a_node_twice(false);
|
||||
|
Loading…
Reference in New Issue
Block a user