]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
reimplement hasSameEngineType()
authorAlex Coyte <a.coyte@intel.com>
Wed, 16 Aug 2017 04:37:05 +0000 (14:37 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 18 Sep 2017 03:29:34 +0000 (13:29 +1000)
src/rose/rose_build_merge.cpp

index 04d5e7d0799db22a49bf9116e7629822debb4e60..94bba13e521bd2748bbcfd9f769fbb2c787b3a6b 100644 (file)
@@ -555,27 +555,13 @@ bool checkPrefix(const rose_literal_id &ul, const u32 ulag,
 static
 bool hasSameEngineType(const RoseVertexProps &u_prop,
                        const RoseVertexProps &v_prop) {
-    const left_id u_left(u_prop.left), v_left(v_prop.left);
+    const left_id u_left = u_prop.left;
+    const left_id v_left = v_prop.left;
 
-    if (u_left.haig() || v_left.haig()) {
-        if (u_left.graph() != v_left.graph()) {
-            return false;
-        }
-    }
-
-    if (u_left.dfa() || v_left.dfa()) {
-        if (u_left.graph() != v_left.graph()) {
-            return false;
-        }
-    }
-
-    if (u_left.castle() || v_left.castle()) {
-        if (!u_left.castle() || !v_left.castle()) {
-            return false; // Must both be castles.
-        }
-    }
-
-    return true;
+    return !u_left.haig() == !v_left.haig()
+        && !u_left.dfa() == !v_left.dfa()
+        && !u_left.castle() == !v_left.castle()
+        && !u_left.graph() == !v_left.graph();
 }
 
 /**