[clang-tidy] remove pointless const
Found with readability-const-return-type Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
a6bbe0e50a
commit
be7492203e
@ -44,7 +44,7 @@ class YAML_CPP_API Emitter {
|
|||||||
|
|
||||||
// state checking
|
// state checking
|
||||||
bool good() const;
|
bool good() const;
|
||||||
const std::string GetLastError() const;
|
std::string GetLastError() const;
|
||||||
|
|
||||||
// global setters
|
// global setters
|
||||||
bool SetOutputCharset(EMITTER_MANIP value);
|
bool SetOutputCharset(EMITTER_MANIP value);
|
||||||
|
|||||||
@ -3,8 +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()) {
|
||||||
if (handle == "!!")
|
if (handle == "!!")
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -25,9 +25,7 @@ std::size_t Emitter::size() const { return m_stream.pos(); }
|
|||||||
// state checking
|
// state checking
|
||||||
bool Emitter::good() const { return m_pState->good(); }
|
bool Emitter::good() const { return m_pState->good(); }
|
||||||
|
|
||||||
const std::string Emitter::GetLastError() const {
|
std::string Emitter::GetLastError() const { return m_pState->GetLastError(); }
|
||||||
return m_pState->GetLastError();
|
|
||||||
}
|
|
||||||
|
|
||||||
// global setters
|
// global setters
|
||||||
bool Emitter::SetOutputCharset(EMITTER_MANIP value) {
|
bool Emitter::SetOutputCharset(EMITTER_MANIP value) {
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include "yaml-cpp/mark.h"
|
#include "yaml-cpp/mark.h"
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
const std::string ScanVerbatimTag(Stream& INPUT) {
|
std::string ScanVerbatimTag(Stream& INPUT) {
|
||||||
std::string tag;
|
std::string tag;
|
||||||
|
|
||||||
// eat the start character
|
// eat the start character
|
||||||
@ -29,7 +29,7 @@ const std::string ScanVerbatimTag(Stream& INPUT) {
|
|||||||
throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
|
throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
|
std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
|
||||||
std::string tag;
|
std::string tag;
|
||||||
canBeHandle = true;
|
canBeHandle = true;
|
||||||
Mark firstNonWordChar;
|
Mark firstNonWordChar;
|
||||||
@ -62,7 +62,7 @@ const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) {
|
|||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string ScanTagSuffix(Stream& INPUT) {
|
std::string ScanTagSuffix(Stream& INPUT) {
|
||||||
std::string tag;
|
std::string tag;
|
||||||
|
|
||||||
while (INPUT) {
|
while (INPUT) {
|
||||||
|
|||||||
@ -11,9 +11,9 @@
|
|||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
|
|
||||||
namespace YAML {
|
namespace YAML {
|
||||||
const std::string ScanVerbatimTag(Stream& INPUT);
|
std::string ScanVerbatimTag(Stream& INPUT);
|
||||||
const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle);
|
std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle);
|
||||||
const std::string ScanTagSuffix(Stream& INPUT);
|
std::string ScanTagSuffix(Stream& INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
#endif // SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user