[gnome-games] game: Don't recalculate title every time



commit 4cb3b599e50308167c6cad29583d60ee6c19de26
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Mar 16 15:46:46 2020 +0500

    game: Don't recalculate title every time
    
    The property already remembers the last result and stores it. Problem is,
    it's never actually used again.

 src/core/game.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/core/game.vala b/src/core/game.vala
index 5e57dd51..0499abec 100644
--- a/src/core/game.vala
+++ b/src/core/game.vala
@@ -6,6 +6,9 @@ public class Games.Game : Object {
        private string _name;
        public string name {
                get {
+                       if (_name != null)
+                               return _name;
+
                        try {
                                _name = game_title.get_title ();
                        }


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