Procházet zdrojové kódy

Remove txn parameter from LSUP_graph_bool_op.

Stefano Cossu před 2 roky
rodič
revize
beb4f18d74
2 změnil soubory, kde provedl 9 přidání a 8 odebrání
  1. 1 1
      include/graph.h
  2. 8 7
      src/graph.c

+ 1 - 1
include/graph.h

@@ -79,7 +79,7 @@ LSUP_graph_copy_contents (const LSUP_Graph *src, LSUP_Graph *dest);
 LSUP_rc
 LSUP_graph_bool_op(
         const LSUP_bool_op op, const LSUP_Graph *gr1, const LSUP_Graph *gr2,
-        void *txn, LSUP_Graph *res);
+        LSUP_Graph *res);
 
 
 /** @brief Free a graph.

+ 8 - 7
src/graph.c

@@ -86,7 +86,7 @@ BACKEND_TBL
 LSUP_rc
 LSUP_graph_bool_op(
         const LSUP_bool_op op, const LSUP_Graph *gr1, const LSUP_Graph *gr2,
-        void *txn, LSUP_Graph *res)
+        LSUP_Graph *res)
 {
     LSUP_rc rc = LSUP_NOACTION;
     if (UNLIKELY (
@@ -116,16 +116,16 @@ LSUP_graph_bool_op(
     LSUP_BufferTriple *sspo = BTRP_DUMMY;
     size_t ct;
 
-    add_it = res->store->sif->add_init_fn (res->store->data, res_sc, txn);
+    add_it = res->store->sif->add_init_fn (res->store->data, res_sc, gr1->txn);
 
     if (op == LSUP_BOOL_XOR) {
         // Add triples from gr2 if not found in gr1.
         lu2_it = gr2->store->sif->lookup_fn (
-                gr2->store->data, NULL, NULL, NULL, gr2_sc, NULL, txn);
+                gr2->store->data, NULL, NULL, NULL, gr2_sc, NULL, gr1->txn);
         while (gr2->store->sif->lu_next_fn (lu2_it, sspo, NULL) == LSUP_OK) {
             lu1_it = gr1->store->sif->lookup_fn (
                     gr1->store->data, sspo->s, sspo->p, sspo->o, gr1_sc,
-                    txn, &ct);
+                    gr1->txn, &ct);
             if (ct > 0)
                 res->store->sif->add_iter_fn (add_it, sspo);
             gr1->store->sif->lu_free_fn (lu1_it);
@@ -134,10 +134,11 @@ LSUP_graph_bool_op(
     }
 
     lu1_it = gr1->store->sif->lookup_fn (
-            gr1->store->data, NULL, NULL, NULL, gr1_sc, txn, NULL);
+            gr1->store->data, NULL, NULL, NULL, gr1_sc, gr1->txn, NULL);
     while (gr1->store->sif->lu_next_fn (lu1_it, sspo, NULL) == LSUP_OK) {
         lu2_it = gr2->store->sif->lookup_fn (
-                gr2->store->data, sspo->s, sspo->p, sspo->o, gr2_sc, txn, &ct);
+                gr2->store->data, sspo->s, sspo->p, sspo->o, gr2_sc,
+                gr1->txn, &ct);
         // For XOR and subtraction, add if not found.
         // For intersection, add if found.
         if ((ct == 0) ^ (op == LSUP_BOOL_INTERSECTION))
@@ -219,7 +220,7 @@ bool
 LSUP_graph_equals (const LSUP_Graph *gr1, const LSUP_Graph *gr2)
 {
     LSUP_Graph *res = LSUP_graph_new (NULL, LSUP_STORE_HTABLE, NULL, NULL, 0);
-    LSUP_graph_bool_op (LSUP_BOOL_XOR, gr1, gr2, gr1->txn, res);
+    LSUP_graph_bool_op (LSUP_BOOL_XOR, gr1, gr2, res);
     bool ret = (LSUP_graph_size (res) == 0);
 
     LSUP_graph_free (res);