Commit 3326c87a authored by Max Kellermann's avatar Max Kellermann

db/Count: add "noexcept"

parent 0ec1863f
...@@ -42,7 +42,7 @@ class TagCountMap : public std::map<std::string, SearchStats> { ...@@ -42,7 +42,7 @@ class TagCountMap : public std::map<std::string, SearchStats> {
}; };
static void static void
PrintSearchStats(Response &r, const SearchStats &stats) PrintSearchStats(Response &r, const SearchStats &stats) noexcept
{ {
unsigned total_duration_s = unsigned total_duration_s =
std::chrono::duration_cast<std::chrono::seconds>(stats.total_duration).count(); std::chrono::duration_cast<std::chrono::seconds>(stats.total_duration).count();
...@@ -53,7 +53,7 @@ PrintSearchStats(Response &r, const SearchStats &stats) ...@@ -53,7 +53,7 @@ PrintSearchStats(Response &r, const SearchStats &stats)
} }
static void static void
Print(Response &r, TagType group, const TagCountMap &m) Print(Response &r, TagType group, const TagCountMap &m) noexcept
{ {
assert(unsigned(group) < TAG_NUM_OF_ITEM_TYPES); assert(unsigned(group) < TAG_NUM_OF_ITEM_TYPES);
...@@ -64,7 +64,7 @@ Print(Response &r, TagType group, const TagCountMap &m) ...@@ -64,7 +64,7 @@ Print(Response &r, TagType group, const TagCountMap &m)
} }
static void static void
stats_visitor_song(SearchStats &stats, const LightSong &song) stats_visitor_song(SearchStats &stats, const LightSong &song) noexcept
{ {
stats.n_songs++; stats.n_songs++;
...@@ -74,7 +74,7 @@ stats_visitor_song(SearchStats &stats, const LightSong &song) ...@@ -74,7 +74,7 @@ stats_visitor_song(SearchStats &stats, const LightSong &song)
} }
static bool static bool
CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag) CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag) noexcept
{ {
bool found = false; bool found = false;
for (const auto &item : tag) { for (const auto &item : tag) {
...@@ -94,7 +94,8 @@ CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag) ...@@ -94,7 +94,8 @@ CollectGroupCounts(TagCountMap &map, TagType group, const Tag &tag)
} }
static void static void
GroupCountVisitor(TagCountMap &map, TagType group, const LightSong &song) GroupCountVisitor(TagCountMap &map, TagType group,
const LightSong &song) noexcept
{ {
assert(song.tag != nullptr); assert(song.tag != nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment