From 99ffbdfdafedb575ec8302872d34121b24b7a047 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 16 Mar 2021 18:09:51 +0100 Subject: [PATCH] vala: Check for unused attributes unconditionally --- vala/valausedattr.vala | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/vala/valausedattr.vala b/vala/valausedattr.vala index b9d8ceb22..a2102acf4 100644 --- a/vala/valausedattr.vala +++ b/vala/valausedattr.vala @@ -132,17 +132,14 @@ public class Vala.UsedAttr : CodeVisitor { } void check_unused_attr (Symbol sym) { - // optimize by not looking at all the symbols - if (sym.used) { - foreach (unowned Attribute attr in sym.attributes) { - var set = marked.get (attr.name); - if (set == null) { - Report.warning (attr.source_reference, "Attribute `%s' never used", attr.name); - } else { - foreach (var arg in attr.args.get_keys()) { - if (!set.contains (arg)) { - Report.warning (attr.source_reference, "Argument `%s' never used", arg); - } + foreach (unowned Attribute attr in sym.attributes) { + var set = marked.get (attr.name); + if (set == null) { + Report.warning (attr.source_reference, "Attribute `%s' never used", attr.name); + } else { + foreach (var arg in attr.args.get_keys()) { + if (!set.contains (arg)) { + Report.warning (attr.source_reference, "Argument `%s' never used", arg); } } } -- 2.47.3