Skip to content

Commit dccee23

Browse files
committed
[clang-tidy] make several member functions const
Found with readability-make-member-function-const Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 parent f519234 commit dccee23

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/scanner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class Scanner {
141141
struct SimpleKey {
142142
SimpleKey(const Mark &mark_, std::size_t flowLevel_);
143143

144-
void Validate();
145-
void Invalidate();
144+
void Validate() const;
145+
void Invalidate() const;
146146

147147
Mark mark;
148148
std::size_t flowLevel;

src/simplekey.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Scanner::SimpleKey::SimpleKey(const Mark& mark_, std::size_t flowLevel_)
1111
pMapStart(nullptr),
1212
pKey(nullptr) {}
1313

14-
void Scanner::SimpleKey::Validate() {
14+
void Scanner::SimpleKey::Validate() const {
1515
// Note: pIndent will *not* be garbage here;
1616
// we "garbage collect" them so we can
1717
// always refer to them
@@ -23,7 +23,7 @@ void Scanner::SimpleKey::Validate() {
2323
pKey->status = Token::VALID;
2424
}
2525

26-
void Scanner::SimpleKey::Invalidate() {
26+
void Scanner::SimpleKey::Invalidate() const {
2727
if (pIndent)
2828
pIndent->status = IndentMarker::INVALID;
2929
if (pMapStart)

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-
std::string Tag::Translate(const Directives& directives) {
32+
std::string Tag::Translate(const Directives& directives) const {
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-
std::string Translate(const Directives& directives);
26+
std::string Translate(const Directives& directives) const;
2727

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

0 commit comments

Comments
 (0)