]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Check for unused attributes unconditionally
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Mar 2021 17:09:51 +0000 (18:09 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 16 Mar 2021 17:09:51 +0000 (18:09 +0100)
vala/valausedattr.vala

index b9d8ceb2233e95cf54abca63dbb8bf599f564cb4..a2102acf41b90235451d6ac54508725ea2bfa94f 100644 (file)
@@ -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);
                                        }
                                }
                        }