From ac743692cb7ce0d6cf8a699b232031cd5b301a38 Mon Sep 17 00:00:00 2001 From: Xanonymous Date: Sun, 18 Aug 2024 22:35:41 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20mappings=20found=20in=20l?= =?UTF-8?q?cs=20shouldn't=20used=20in=20histogram=20phrase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/tw/xcc/gumtree/matchers/BottomUpMatcher.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/kotlin/tw/xcc/gumtree/matchers/BottomUpMatcher.kt b/core/src/main/kotlin/tw/xcc/gumtree/matchers/BottomUpMatcher.kt index de0014e..ea25d15 100644 --- a/core/src/main/kotlin/tw/xcc/gumtree/matchers/BottomUpMatcher.kt +++ b/core/src/main/kotlin/tw/xcc/gumtree/matchers/BottomUpMatcher.kt @@ -58,6 +58,11 @@ class BottomUpMatcher : TreeMatcher { if ((leftNodes != null && rightNodes != null) && (leftNodes.size == 1 && rightNodes.size == 1)) { val left = leftNodes.single() val right = rightNodes.single() + + if (storage.isLeftMapped(left) || storage.isRightMapped(right)) { + return@forEach + } + storage.addMappingOf( realTreePool.tryExtractRealOf(left to right) )