mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 04:11:17 +00:00
Small perfomance optimization in Directives and Tag methods (#1112)
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user