aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/example_metadata_key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/cplusplus/examples/example_metadata_key.cc')
-rw-r--r--doc/api/cplusplus/examples/example_metadata_key.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/api/cplusplus/examples/example_metadata_key.cc b/doc/api/cplusplus/examples/example_metadata_key.cc
index f61d5f3cf..2f803399e 100644
--- a/doc/api/cplusplus/examples/example_metadata_key.cc
+++ b/doc/api/cplusplus/examples/example_metadata_key.cc
@@ -34,7 +34,10 @@ namespace
std::string stringify_string_pair(const std::pair<const std::string, std::string> & s)
{
- return s.first + "=" + s.second;
+ if (s.first.empty())
+ return s.second;
+ else
+ return s.first + "=" + s.second;
}
/* We use this visitor to display extra information about a MetadataKey,