[gnome-games/wip/exalm/performance: 10/10] mame: Use an intermediate variable in get_supported_games()



commit 961af079aaf22aefc8e20bce80a270c2eb1c0e9f
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Sep 9 11:36:33 2018 +0500

    mame: Use an intermediate variable in get_supported_games()
    
    This forces Vala->C translator to introduce an additional variable for the
    array length instead of recomputing it on every iteration.

 plugins/mame/src/mame-game-info.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/plugins/mame/src/mame-game-info.vala b/plugins/mame/src/mame-game-info.vala
index fbb57792..1ca07b32 100644
--- a/plugins/mame/src/mame-game-info.vala
+++ b/plugins/mame/src/mame-game-info.vala
@@ -28,7 +28,8 @@ private struct Games.MameGameInfo {
                        yield;
                }
 
-               foreach (var line in text.split ("\n")) {
+               var lines = text.split ("\n");
+               foreach (var line in lines) {
                        MatchInfo match_info;
                        if (!game_regex.match (line, 0, out match_info))
                                continue;


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