Unverified Commit c73ee347 by Igor [hyperxor] Committed by GitHub

Small perfomance optimization in Directives and Tag methods (#1112)

parent 190ad502
......@@ -3,7 +3,7 @@
namespace YAML {
Directives::Directives() : version{true, 1, 2}, tags{} {}
const std::string Directives::TranslateTagHandle(
std::string Directives::TranslateTagHandle(
const std::string& handle) const {
auto it = tags.find(handle);
if (it == tags.end()) {
......
......@@ -19,7 +19,7 @@ struct Version {
struct Directives {
Directives();
const std::string TranslateTagHandle(const std::string& handle) const;
std::string TranslateTagHandle(const std::string& handle) const;
Version version;
std::map<std::string, std::string> tags;
......
......@@ -29,7 +29,7 @@ Tag::Tag(const Token& token)
}
}
const std::string Tag::Translate(const Directives& directives) {
std::string Tag::Translate(const Directives& directives) {
switch (type) {
case VERBATIM:
return value;
......
......@@ -23,7 +23,7 @@ struct Tag {
};
Tag(const Token& token);
const std::string Translate(const Directives& directives);
std::string Translate(const Directives& directives);
TYPE type;
std::string handle, value;
......
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