@@ -561,7 +561,7 @@ protected void filterUsedIds(Collection<Long> ids) throws IOException {
561561 keyBuf .clear ();
562562 Varint .writeUnsigned (keyBuf , id );
563563 keyData .mv_data (keyBuf .flip ());
564- if (E ( mdb_get (txn , contextsDbi , keyData , valueData ) ) == MDB_SUCCESS ) {
564+ if (mdb_get (txn , contextsDbi , keyData , valueData ) == MDB_SUCCESS ) {
565565 it .remove ();
566566 }
567567 }
@@ -587,15 +587,15 @@ protected void filterUsedIds(Collection<Long> ids) throws IOException {
587587
588588 if (fullScan ) {
589589 long [] quad = new long [4 ];
590- int rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_FIRST ) );
590+ int rc = mdb_cursor_get (cursor , keyData , valueData , MDB_FIRST );
591591 while (rc == MDB_SUCCESS && !ids .isEmpty ()) {
592592 index .keyToQuad (keyData .mv_data (), quad );
593593 ids .remove (quad [0 ]);
594594 ids .remove (quad [1 ]);
595595 ids .remove (quad [2 ]);
596596 ids .remove (quad [3 ]);
597597
598- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT ) );
598+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT );
599599 }
600600 } else {
601601 for (Iterator <Long > it = ids .iterator (); it .hasNext ();) {
@@ -625,15 +625,15 @@ protected void filterUsedIds(Collection<Long> ids) throws IOException {
625625
626626 // set cursor to min key
627627 keyData .mv_data (keyBuf );
628- int rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE ) );
628+ int rc = mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE );
629629 boolean exists = false ;
630- while (!exists && rc == 0 ) {
630+ while (!exists && rc == MDB_SUCCESS ) {
631631 if (mdb_cmp (txn , dbi , keyData , maxKey ) > 0 ) {
632632 // id was not found
633633 break ;
634634 } else if (!matcher .matches (keyData .mv_data ())) {
635635 // value doesn't match search key/mask, fetch next value
636- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT ) );
636+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT );
637637 } else {
638638 exists = true ;
639639 }
@@ -708,24 +708,24 @@ protected double cardinality(long subj, long pred, long obj, long context) throw
708708
709709 // set cursor to min key
710710 keyData .mv_data (keyBuf );
711- int rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE ) );
712- if (rc != 0 || mdb_cmp (txn , dbi , keyData , maxKey ) >= 0 ) {
711+ int rc = mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE );
712+ if (rc != MDB_SUCCESS || mdb_cmp (txn , dbi , keyData , maxKey ) >= 0 ) {
713713 break ;
714714 } else {
715715 Varint .readListUnsigned (keyData .mv_data (), s .minValues );
716716 }
717717
718718 // set cursor to max key
719719 keyData .mv_data (maxKeyBuf );
720- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE ) );
721- if (rc != 0 ) {
720+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE );
721+ if (rc != MDB_SUCCESS ) {
722722 // directly go to last value
723- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_LAST ) );
723+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_LAST );
724724 } else {
725725 // go to previous value of selected key
726- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_PREV ) );
726+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_PREV );
727727 }
728- if (rc == 0 ) {
728+ if (rc == MDB_SUCCESS ) {
729729 Varint .readListUnsigned (keyData .mv_data (), s .maxValues );
730730 // this is required to correctly estimate the range size at a later point
731731 s .startValues [s .MAX_BUCKETS ] = s .maxValues ;
@@ -747,7 +747,7 @@ protected double cardinality(long subj, long pred, long obj, long context) throw
747747 keyData .mv_data (keyBuf );
748748
749749 int currentSamplesCount = 0 ;
750- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE ) );
750+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_SET_RANGE );
751751 while (rc == MDB_SUCCESS && currentSamplesCount < s .MAX_SAMPLES_PER_BUCKET ) {
752752 if (mdb_cmp (txn , dbi , keyData , maxKey ) >= 0 ) {
753753 endOfRange = true ;
@@ -776,8 +776,8 @@ protected double cardinality(long subj, long pred, long obj, long context) throw
776776 }
777777 }
778778 }
779- rc = E ( mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT ) );
780- if (rc != 0 ) {
779+ rc = mdb_cursor_get (cursor , keyData , valueData , MDB_NEXT );
780+ if (rc != MDB_SUCCESS ) {
781781 // no more elements are available
782782 endOfRange = true ;
783783 }
@@ -873,14 +873,14 @@ public boolean storeTriple(long subj, long pred, long obj, long context, boolean
873873 return recordCache .storeRecord (quad , explicit );
874874 }
875875
876- int rc = E ( mdb_put (writeTxn , mainIndex .getDB (explicit ), keyVal , dataVal , MDB_NOOVERWRITE ) );
876+ int rc = mdb_put (writeTxn , mainIndex .getDB (explicit ), keyVal , dataVal , MDB_NOOVERWRITE );
877877 if (rc != MDB_SUCCESS && rc != MDB_KEYEXIST ) {
878878 throw new IOException (mdb_strerror (rc ));
879879 }
880880 stAdded = rc == MDB_SUCCESS ;
881881 boolean foundImplicit = false ;
882882 if (explicit && stAdded ) {
883- foundImplicit = E ( mdb_del (writeTxn , mainIndex .getDB (false ), keyVal , dataVal ) ) == MDB_SUCCESS ;
883+ foundImplicit = mdb_del (writeTxn , mainIndex .getDB (false ), keyVal , dataVal ) == MDB_SUCCESS ;
884884 }
885885
886886 if (stAdded ) {
@@ -920,7 +920,7 @@ private void incrementContext(MemoryStack stack, long context) throws IOExceptio
920920 idVal .mv_data (bb );
921921 MDBVal dataVal = MDBVal .calloc (stack );
922922 long newCount = 1 ;
923- if (E ( mdb_get (writeTxn , contextsDbi , idVal , dataVal ) ) == MDB_SUCCESS ) {
923+ if (mdb_get (writeTxn , contextsDbi , idVal , dataVal ) == MDB_SUCCESS ) {
924924 // update count
925925 newCount = Varint .readUnsigned (dataVal .mv_data ()) + 1 ;
926926 }
@@ -944,7 +944,7 @@ private boolean decrementContext(MemoryStack stack, long context) throws IOExcep
944944 bb .flip ();
945945 idVal .mv_data (bb );
946946 MDBVal dataVal = MDBVal .calloc (stack );
947- if (E ( mdb_get (writeTxn , contextsDbi , idVal , dataVal ) ) == MDB_SUCCESS ) {
947+ if (mdb_get (writeTxn , contextsDbi , idVal , dataVal ) == MDB_SUCCESS ) {
948948 // update count
949949 long newCount = Varint .readUnsigned (dataVal .mv_data ()) - 1 ;
950950 if (newCount <= 0 ) {
0 commit comments