瀏覽代碼

Added a small optimization to possibility comparision.

Taddeus Kroes 14 年之前
父節點
當前提交
e796e899cc
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/strategy.py

+ 4 - 0
src/strategy.py

@@ -13,6 +13,10 @@ def compare_possibilities(a, b):
     (pa, da), (pb, db) = a, b
     ha, hb = pa.handler, pb.handler
 
+    # Equal handlers means equal precedences
+    if ha == hb:
+        return 0
+
     # Check if A and B have a precedence relative to eachother
     if (ha, hb) in RELATIVE:
         return -1