Skip to content

Commit 2caca13

Browse files
committed
RequirementMachine: Const correctness
1 parent 63ac80b commit 2caca13

File tree

1 file changed

+3
-3
lines changed
  • lib/AST/RequirementMachine

1 file changed

+3
-3
lines changed

lib/AST/RequirementMachine/Trie.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class Trie {
137137
/// Find all keys that begin with the given symbol. Fn must take a single
138138
/// argument of type ValueType.
139139
template<typename Fn>
140-
void findAll(Symbol symbol, Fn fn) {
140+
void findAll(Symbol symbol, Fn fn) const {
141141
auto found = Root.Entries.find(symbol);
142142
if (found == Root.Entries.end())
143143
return;
@@ -157,7 +157,7 @@ class Trie {
157157
/// [begin,end) matches a prefix of the key. Fn must take a single
158158
/// argument of type ValueType.
159159
template<typename Iter, typename Fn>
160-
void findAll(Iter begin, Iter end, Fn fn) {
160+
void findAll(Iter begin, Iter end, Fn fn) const {
161161
assert(begin != end);
162162
auto *node = &Root;
163163

@@ -189,7 +189,7 @@ class Trie {
189189
/// Depth-first traversal of all children of the given node, including
190190
/// the node itself. Fn must take a single argument of type ValueType.
191191
template<typename Fn>
192-
void visitChildren(Node *node, Fn fn) {
192+
void visitChildren(const Node *node, Fn fn) const {
193193
for (const auto &pair : node->Entries) {
194194
const auto &entry = pair.second;
195195
if (entry.Value)

0 commit comments

Comments
 (0)