[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: Tue, 11 Sep 2018 11:51:26 +0000 (UTC)
commit e3648e8feda2a0b3e8e86f5c765314ef9837d202
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]