summaryrefslogtreecommitdiff
path: root/src/output.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/output.cc')
-rw-r--r--src/output.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/output.cc b/src/output.cc
index 418140ae..2a8c8201 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -332,18 +332,19 @@ void report_tags::flush()
void report_tags::gather_metadata(item_t& item)
{
- if (item.metadata)
- foreach (const item_t::string_map::value_type& data, *item.metadata) {
- string tag(data.first);
- if (report.HANDLED(values) && data.second.first)
- tag += ": " + data.second.first.get().to_string();
-
- std::map<string, std::size_t>::iterator i = tags.find(tag);
- if (i == tags.end())
- tags.insert(tags_pair(tag, 1));
- else
- (*i).second++;
- }
+ if (! item.metadata)
+ return;
+ foreach (const item_t::string_map::value_type& data, *item.metadata) {
+ string tag(data.first);
+ if (report.HANDLED(values) && data.second.first)
+ tag += ": " + data.second.first.get().to_string();
+
+ std::map<string, std::size_t>::iterator i = tags.find(tag);
+ if (i == tags.end())
+ tags.insert(tags_pair(tag, 1));
+ else
+ (*i).second++;
+ }
}
void report_tags::operator()(post_t& post)