Fixes append map bug when key matches value in existing map #1200

This commit is contained in:
Mike Farah
2022-04-28 14:45:45 +10:00
parent 26529fae94
commit 67c79b7cb1
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ func addMaps(target *CandidateNode, lhsC *CandidateNode, rhsC *CandidateNode) {
key := rhs.Content[index]
value := rhs.Content[index+1]
log.Debug("finding %v", key.Value)
indexInLHS := findInArray(target.Node, key)
indexInLHS := findKeyInMap(target.Node, key)
log.Debug("indexInLhs %v", indexInLHS)
if indexInLHS < 0 {
// not in there, append it