Skip to content

Commit c73ee34

Browse files
authored
Small perfomance optimization in Directives and Tag methods (jbeder#1112)
1 parent 190ad50 commit c73ee34

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/directives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace YAML {
44
Directives::Directives() : version{true, 1, 2}, tags{} {}
55

6-
const std::string Directives::TranslateTagHandle(
6+
std::string Directives::TranslateTagHandle(
77
const std::string& handle) const {
88
auto it = tags.find(handle);
99
if (it == tags.end()) {

src/directives.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Version {
1919
struct Directives {
2020
Directives();
2121

22-
const std::string TranslateTagHandle(const std::string& handle) const;
22+
std::string TranslateTagHandle(const std::string& handle) const;
2323

2424
Version version;
2525
std::map<std::string, std::string> tags;

src/tag.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Tag::Tag(const Token& token)
2929
}
3030
}
3131

32-
const std::string Tag::Translate(const Directives& directives) {
32+
std::string Tag::Translate(const Directives& directives) {
3333
switch (type) {
3434
case VERBATIM:
3535
return value;

src/tag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct Tag {
2323
};
2424

2525
Tag(const Token& token);
26-
const std::string Translate(const Directives& directives);
26+
std::string Translate(const Directives& directives);
2727

2828
TYPE type;
2929
std::string handle, value;

0 commit comments

Comments
 (0)