diff options
author | Denis Dzyubenko <shadone@gmail.com> | 2014-01-14 01:56:48 +0400 |
---|---|---|
committer | Denis Dzyubenko <shadone@gmail.com> | 2014-01-14 01:56:48 +0400 |
commit | 364cbf54f2530d7215839c5ed0bee018f95b6ae0 (patch) | |
tree | 8767813fc570d6044bd8510b810038ed57302a7a | |
parent | fc653c372990d7c6e594604aa9537bd693504250 (diff) |
Removed silly code.
We already have the time, no need to query the system again.
-rw-r--r-- | src/pebble-mario.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pebble-mario.c b/src/pebble-mario.c index d095a8b..4febfa6 100644 --- a/src/pebble-mario.c +++ b/src/pebble-mario.c @@ -439,18 +439,15 @@ void handle_tick(struct tm *tick_time, TimeUnits units_changed) hour_format = "%I"; } - time_t current_time = time(NULL); - struct tm *tm = localtime(¤t_time); - - strftime(hour_text, sizeof(hour_text), hour_format, tm); + strftime(hour_text, sizeof(hour_text), hour_format, tick_time); if (!clock_is_24h_style() && (hour_text[0] == '0')) { memmove(hour_text, &hour_text[1], sizeof(hour_text) - 1); } char *minute_format = "%M"; - strftime(minute_text, sizeof(minute_text), minute_format, tm); + strftime(minute_text, sizeof(minute_text), minute_format, tick_time); - strftime(date_text, sizeof(date_text), "%a, %b %d", tm); + strftime(date_text, sizeof(date_text), "%a, %b %d", tick_time); animation_schedule((Animation *)mario_animation_beg); animation_schedule((Animation *)block_animation_beg); |