[gnome-games/gnome-3-30] mame: Use an intermediate variable in get_supported_games()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/gnome-3-30] mame: Use an intermediate variable in get_supported_games()
- Date: Tue, 11 Sep 2018 12:22:14 +0000 (UTC)
commit a3964d9a0c685fa0b233f6d925b77a2fbe7996dc
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Sep 9 06:36:33 2018 +0000
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.
(cherry picked from commit e3648e8feda2a0b3e8e86f5c765314ef9837d202)
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 be08436b..94492908 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]