[PPL-devel] [GIT] ppl/ppl(master): Further improved subset_or_equal(const Bit_Row&, const Bit_Row&, bool&).

Roberto Bagnara bagnara at cs.unipr.it
Mon Apr 20 13:51:19 CEST 2009


Module: ppl/ppl
Branch: master
Commit: ead61e70bbce24c517afc3f79d2285b8abcfdb4c
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=ead61e70bbce24c517afc3f79d2285b8abcfdb4c

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Mon Apr 20 13:50:09 2009 +0200

Further improved subset_or_equal(const Bit_Row&, const Bit_Row&, bool&).

---

 src/Bit_Row.cc |   51 ++++++++++++++++++++++++++-------------------------
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/src/Bit_Row.cc b/src/Bit_Row.cc
index 688fff8..eee1cbf 100644
--- a/src/Bit_Row.cc
+++ b/src/Bit_Row.cc
@@ -282,33 +282,34 @@ PPL::subset_or_equal(const Bit_Row& x, const Bit_Row& y,
   mp_srcptr xp = x.vec->_mp_d;
   mp_srcptr yp = y.vec->_mp_d;
   strict_subset = (x_size < y_size);
-  if (strict_subset)
-    goto strict_subset_loop;
-
-  while (x_size > 0) {
-    const mp_limb_t xl = *xp;
-    const mp_limb_t yl = *yp;
-    if (xl & ~yl)
-      return false;
-    ++xp;
-    ++yp;
-    --x_size;
-    if (xl != yl) {
-      strict_subset = true;
-      goto strict_subset_loop;
+  mp_limb_t xl;
+  mp_limb_t yl;
+  if (strict_subset) {
+    while (x_size > 0) {
+      xl = *xp;
+      yl = *yp;
+      if (xl & ~yl)
+	return false;
+    strict_subset_next:
+      ++xp;
+      ++yp;
+      --x_size;
     }
   }
-  return true;
-
- strict_subset_loop:
-  while (x_size > 0) {
-    const mp_limb_t xl = *xp;
-    const mp_limb_t yl = *yp;
-    if (xl & ~yl)
-      return false;
-    ++xp;
-    ++yp;
-    --x_size;
+  else {
+    while (x_size > 0) {
+      xl = *xp;
+      yl = *yp;
+      if (xl != yl) {
+	if (xl & ~yl)
+	  return false;
+	strict_subset = true;
+	goto strict_subset_next;
+      }
+      ++xp;
+      ++yp;
+      --x_size;
+    }
   }
   return true;
 }




More information about the PPL-devel mailing list