From 75542e8f5d615c31282e6e8562bb1b71222af999 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 27 Apr 2014 22:27:28 +0200 Subject: db/Count: add constructor --- src/db/Count.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/db/Count.cxx b/src/db/Count.cxx index 4fa1c02a3..8c61e4c21 100644 --- a/src/db/Count.cxx +++ b/src/db/Count.cxx @@ -29,6 +29,9 @@ struct SearchStats { unsigned n_songs; unsigned long total_time_s; + + constexpr SearchStats() + :n_songs(0), total_time_s(0) {} }; static void @@ -61,8 +64,6 @@ PrintSongCount(Client &client, const char *name, const DatabaseSelection selection(name, true, filter); SearchStats stats; - stats.n_songs = 0; - stats.total_time_s = 0; using namespace std::placeholders; const auto f = std::bind(stats_visitor_song, std::ref(stats), -- cgit v1.2.3