aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Magahern <james@magahern.com>2019-01-20 02:21:07 -0800
committerJames Magahern <james@magahern.com>2019-01-20 02:21:07 -0800
commitdead5625986ddcf030c3f99249f5c07aa93ebca0 (patch)
tree5b16068fd4f60b8694ada54e08e5a8c1f0eec082
parentSensible framerate (diff)
Little code optimization here
-rw-r--r--src/main.c7
1 files changed, 1 insertions, 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