From 570150bc86c104529a249ccd59f00a492011a9db Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Aug 2020 08:14:21 -0400 Subject: perf_stats: Make use of designated initializers Same behavior, but allows us to avoid a now-unnecessary zero initialization. --- src/core/perf_stats.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 36372c66f..b899ac884 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp @@ -95,12 +95,13 @@ PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; - PerfStatsResults results{}; - results.system_fps = static_cast(system_frames) / interval; - results.game_fps = static_cast(game_frames) / interval; - results.frametime = duration_cast(accumulated_frametime).count() / - static_cast(system_frames); - results.emulation_speed = system_us_per_second.count() / 1'000'000.0; + const PerfStatsResults results{ + .system_fps = static_cast(system_frames) / interval, + .game_fps = static_cast(game_frames) / interval, + .frametime = duration_cast(accumulated_frametime).count() / + static_cast(system_frames), + .emulation_speed = system_us_per_second.count() / 1'000'000.0, + }; // Reset counters reset_point = now; -- cgit v1.2.3