mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 20:31:17 +00:00
Small perfomance optimization in Directives and Tag methods (#1112)
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
namespace YAML {
|
namespace YAML {
|
||||||
Directives::Directives() : version{true, 1, 2}, tags{} {}
|
Directives::Directives() : version{true, 1, 2}, tags{} {}
|
||||||
|
|
||||||
const std::string Directives::TranslateTagHandle(
|
std::string Directives::TranslateTagHandle(
|
||||||
const std::string& handle) const {
|
const std::string& handle) const {
|
||||||
auto it = tags.find(handle);
|
auto it = tags.find(handle);
|
||||||
if (it == tags.end()) {
|
if (it == tags.end()) {
|
||||||
|
@@ -19,7 +19,7 @@ struct Version {
|
|||||||
struct Directives {
|
struct Directives {
|
||||||
Directives();
|
Directives();
|
||||||
|
|
||||||
const std::string TranslateTagHandle(const std::string& handle) const;
|
std::string TranslateTagHandle(const std::string& handle) const;
|
||||||
|
|
||||||
Version version;
|
Version version;
|
||||||
std::map<std::string, std::string> tags;
|
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) {
|
switch (type) {
|
||||||
case VERBATIM:
|
case VERBATIM:
|
||||||
return value;
|
return value;
|
||||||
|
Reference in New Issue
Block a user