"git@developer.sourcefind.cn:modelzoo/qwen_lmdeploy.git" did not exist on "c261b49d5a4db2cdd26738e3df209e5a9068a479"
Commit 99d95d8e authored by Andy Maloney's avatar Andy Maloney Committed by Jesse Beder
Browse files

Pass std::string by const ref (#749)

parent a6ed66ab
...@@ -74,14 +74,14 @@ struct _Alias { ...@@ -74,14 +74,14 @@ struct _Alias {
std::string content; std::string content;
}; };
inline _Alias Alias(const std::string content) { return _Alias(content); } inline _Alias Alias(const std::string& content) { return _Alias(content); }
struct _Anchor { struct _Anchor {
_Anchor(const std::string& content_) : content(content_) {} _Anchor(const std::string& content_) : content(content_) {}
std::string content; std::string content;
}; };
inline _Anchor Anchor(const std::string content) { return _Anchor(content); } inline _Anchor Anchor(const std::string& content) { return _Anchor(content); }
struct _Tag { struct _Tag {
struct Type { struct Type {
...@@ -96,11 +96,11 @@ struct _Tag { ...@@ -96,11 +96,11 @@ struct _Tag {
Type::value type; Type::value type;
}; };
inline _Tag VerbatimTag(const std::string content) { inline _Tag VerbatimTag(const std::string& content) {
return _Tag("", content, _Tag::Type::Verbatim); return _Tag("", content, _Tag::Type::Verbatim);
} }
inline _Tag LocalTag(const std::string content) { inline _Tag LocalTag(const std::string& content) {
return _Tag("", content, _Tag::Type::PrimaryHandle); return _Tag("", content, _Tag::Type::PrimaryHandle);
} }
...@@ -108,7 +108,7 @@ inline _Tag LocalTag(const std::string& prefix, const std::string content) { ...@@ -108,7 +108,7 @@ inline _Tag LocalTag(const std::string& prefix, const std::string content) {
return _Tag(prefix, content, _Tag::Type::NamedHandle); return _Tag(prefix, content, _Tag::Type::NamedHandle);
} }
inline _Tag SecondaryTag(const std::string content) { inline _Tag SecondaryTag(const std::string& content) {
return _Tag("", content, _Tag::Type::NamedHandle); return _Tag("", content, _Tag::Type::NamedHandle);
} }
...@@ -117,7 +117,7 @@ struct _Comment { ...@@ -117,7 +117,7 @@ struct _Comment {
std::string content; std::string content;
}; };
inline _Comment Comment(const std::string content) { return _Comment(content); } inline _Comment Comment(const std::string& content) { return _Comment(content); }
struct _Precision { struct _Precision {
_Precision(int floatPrecision_, int doublePrecision_) _Precision(int floatPrecision_, int doublePrecision_)
......
...@@ -223,7 +223,7 @@ inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark, ...@@ -223,7 +223,7 @@ inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark,
class YAML_CPP_API InvalidNode : public RepresentationException { class YAML_CPP_API InvalidNode : public RepresentationException {
public: public:
InvalidNode(std::string key) InvalidNode(const std::string& key)
: RepresentationException(Mark::null_mark(), : RepresentationException(Mark::null_mark(),
ErrorMsg::INVALID_NODE_WITH_KEY(key)) {} ErrorMsg::INVALID_NODE_WITH_KEY(key)) {}
InvalidNode(const InvalidNode&) = default; InvalidNode(const InvalidNode&) = default;
......
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