]> git.itanic.dy.fi Git - sdl-planets/commitdiff
main.c: Simplify the list access a bit
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 15:25:17 +0000 (17:25 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sun, 7 Mar 2010 15:25:17 +0000 (17:25 +0200)
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
main.c

diff --git a/main.c b/main.c
index 130ffcc2744628bae9c793f0cf27a91572a4d692..2c442afaebfff333194cfbe907abc718d6903af3 100644 (file)
--- a/main.c
+++ b/main.c
@@ -44,11 +44,10 @@ static void loop(SDL_Surface *screen, int num_of_planets)
 
        ticks = SDL_GetTicks();
        while (1) {
-               struct list_head *l;
                planets = 0;
+
                list_for_each_entry(pl1, &planet->list, list) {
-                       l = pl1->list.next;
-                       pl2 = list_to_planet(l);
+                       pl2 = list_to_planet(pl1->list.next);
                        list_for_each_entry_from(pl2, &planet->list, list) {
                                struct planet *ptmp;
                                if (!gravitize_planets(pl1, pl2, time))