[gnome-games/wip/exalm/grilo: 6/6] grilo: Do not store registry and metadata key as class fields



commit abb44f6f655f185a9442d787b99f310706362e5f
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Fri Aug 31 17:16:35 2018 +0500

    grilo: Do not store registry and metadata key as class fields
    
    They are only used once, so make them local variables instead.

 src/grilo/grilo-cooperative.vala | 6 ++----
 src/grilo/grilo-players.vala     | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/grilo/grilo-cooperative.vala b/src/grilo/grilo-cooperative.vala
index ba64bfb1..aa9699cd 100644
--- a/src/grilo/grilo-cooperative.vala
+++ b/src/grilo/grilo-cooperative.vala
@@ -2,8 +2,6 @@
 
 public class Games.GriloCooperative : Object, Cooperative {
        private GriloMedia media;
-       private Grl.KeyID metadata_key;
-       private Grl.Registry registry;
        private bool cooperative;
        private bool resolving;
 
@@ -29,8 +27,8 @@ public class Games.GriloCooperative : Object, Cooperative {
                if (grl_media == null)
                        return;
 
-               registry = Grl.Registry.get_default ();
-               metadata_key = registry.lookup_metadata_key ("coop");
+               var registry = Grl.Registry.get_default ();
+               var metadata_key = registry.lookup_metadata_key ("coop");
 
                if (grl_media.length (metadata_key) == 0)
                        return;
diff --git a/src/grilo/grilo-players.vala b/src/grilo/grilo-players.vala
index bc20f6c1..b25c022e 100644
--- a/src/grilo/grilo-players.vala
+++ b/src/grilo/grilo-players.vala
@@ -2,8 +2,6 @@
 
 public class Games.GriloPlayers : Object, Players {
        private GriloMedia media;
-       private Grl.Registry registry;
-       private Grl.KeyID metadata_key;
        private string players;
        private bool resolving;
 
@@ -32,8 +30,8 @@ public class Games.GriloPlayers : Object, Players {
                if (grl_media == null)
                        return;
 
-               registry = Grl.Registry.get_default ();
-               metadata_key = registry.lookup_metadata_key ("players");
+               var registry = Grl.Registry.get_default ();
+               var metadata_key = registry.lookup_metadata_key ("players");
 
                if (grl_media.length (metadata_key) == 0)
                        return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]