compiler/PPCOptimizeChoices.st
changeset 459 4751c407bb40
parent 452 9f4558b3be66
--- a/compiler/PPCOptimizeChoices.st	Sun May 10 06:28:36 2015 +0100
+++ b/compiler/PPCOptimizeChoices.st	Tue May 12 01:24:03 2015 +0100
@@ -12,15 +12,23 @@
 !PPCOptimizeChoices methodsFor:'as yet unclassified'!
 
 hasCommonPrefix: nodes
-    | firstSets |
+    | firstSets firstSetValues |
     firstSets := IdentityDictionary new.
     
     nodes do: [ :node |
         firstSets at: node put: node firstSetWithProductions.
     ].
 
-    firstSets values allPairsDo: [ :p1 :p2 | (p1 = p2) ifFalse: [ ^ false ] ].
+    firstSetValues := firstSets values.
+
+    firstSetValues do: [ :p1 |
+        firstSetValues do:[ :p2 | 
+            (p1 = p2) ifFalse: [ ^ false ] 
+        ].
+    ].
     ^ true
+
+    "Modified: / 10-05-2015 / 07:32:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 visitChoiceNode: node