From dead5625986ddcf030c3f99249f5c07aa93ebca0 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Sun, 20 Jan 2019 02:21:07 -0800 Subject: Little code optimization here --- src/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 2a4c04e..1bcb21b 100644 --- a/src/main.c +++ b/src/main.c @@ -279,7 +279,7 @@ static int runloop(cairo_surface_t *surface) const int frames_per_sec = 60; const long sleep_nsec = (1.0 / frames_per_sec) * 1000000000; struct timespec sleep_time = { 0, sleep_nsec }; - for (;;) { + while (!state.is_authenticated) { update(&state); cairo_push_group(cr); @@ -292,11 +292,6 @@ static int runloop(cairo_surface_t *surface) cairo_surface_flush(surface); nanosleep(&sleep_time, NULL); - - if (state.is_authenticated) { - // We're done here - break; - } } // Cleanup -- cgit v1.2.3