summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <jwiegley@gmail.com>2017-10-26 15:19:12 -0700
committerGitHub <noreply@github.com>2017-10-26 15:19:12 -0700
commit9f6825fb428b08f7f26b880a692d74aba25ea682 (patch)
tree6662df51595cffd3ecdec833f9f0b48629629fa0 /src
parent38171f39e84b6f3d9405795e93b0ffc98413b918 (diff)
parent0a401f2ff037a35f779b21a2fdb5974c7396e9ef (diff)
downloadfork-ledger-9f6825fb428b08f7f26b880a692d74aba25ea682.tar.gz
fork-ledger-9f6825fb428b08f7f26b880a692d74aba25ea682.tar.bz2
fork-ledger-9f6825fb428b08f7f26b880a692d74aba25ea682.zip
Merge pull request #490 from sunny256/fix-braces-warning
Remove compiler warning about missing braces
Diffstat (limited to 'src')
-rw-r--r--src/output.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/output.cc b/src/output.cc
index c6c8ecd7..2a8c8201 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -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)