[gnome-games/wip/exalm/performance: 2/2] 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/wip/exalm/performance: 2/2] mame: Use an intermediate variable in get_supported_games()
- Date: Mon, 10 Sep 2018 09:47:04 +0000 (UTC)
commit 976a1b65eb74d4139cd7098a9c44547bfee206d5
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 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]