diff options
author | James Magahern <james@magahern.com> | 2019-01-20 02:21:07 -0800 |
---|---|---|
committer | James Magahern <james@magahern.com> | 2019-01-20 02:21:07 -0800 |
commit | dead5625986ddcf030c3f99249f5c07aa93ebca0 (patch) | |
tree | 5b16068fd4f60b8694ada54e08e5a8c1f0eec082 | |
parent | Sensible framerate (diff) |
Little code optimization here
-rw-r--r-- | src/main.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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 |