[libgames-support] Simplify add_score a bit



commit a66e004d4da6a664df1904654d8ee4093c7f9a40
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Sep 20 17:21:30 2015 -0500

    Simplify add_score a bit

 games/scores/context.vala |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index 3558b7a..5885075 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -171,18 +171,12 @@ public class Context : Object
         if (scores_per_category[category].add (score))
             current_category = category;
 
-        if (!high_score_added)
-        {
-            yield save_score_to_file (score, category);
-            return false;
-        }
-        else
-        {
-            /* The score's player name can change while the dialog is running. */
+        /* Note that the score's player name can change while the dialog is running. */
+        if (high_score_added)
             run_dialog_internal (score);
-            yield save_score_to_file (score, current_category);
-            return true;
-        }
+
+        yield save_score_to_file (score, current_category);
+        return high_score_added;
     }
 
     private async void save_score_to_file (Score score, Category category) throws Error


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