Skip to content

Commit 65e9dd1

Browse files
committed
RequirementMachine: Trie.insert() updates existing entry
1 parent 866a049 commit 65e9dd1

File tree

1 file changed

+2
-4
lines changed
  • lib/AST/RequirementMachine

1 file changed

+2
-4
lines changed

lib/AST/RequirementMachine/Trie.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,9 @@ class Trie {
8383
++begin;
8484

8585
if (begin == end) {
86-
if (entry.Value)
87-
return entry.Value;
88-
86+
auto oldValue = entry.Value;
8987
entry.Value = value;
90-
return None;
88+
return oldValue;
9189
}
9290

9391
if (entry.Children == nullptr) {

0 commit comments

Comments
 (0)