C: AVL trees: fixed a bug where storing the difference between 2 crc64
values in an int64 would mess trees up resulting in failed data dereplication
This commit is contained in:
@ -307,8 +307,8 @@ cdef uniq_sequences(View_NUC_SEQS view, View_NUC_SEQS o_view, ProgressBar pb, di
|
|||||||
for x in categories :
|
for x in categories :
|
||||||
catl.append(i_seq[x])
|
catl.append(i_seq[x])
|
||||||
|
|
||||||
unique_id = tuple(catl) + (i_seq_col[i],)
|
#unique_id = tuple(catl) + (i_seq_col[i],)
|
||||||
#unique_id = tuple(catl) + (i_seq_col.get_line_idx(i),)
|
unique_id = tuple(catl) + (i_seq_col.get_line_idx(i),)
|
||||||
#unique_id = tuple(i_seq[x] for x in categories) + (seq_col.get_line_idx(i),) # The line that cython can't read properly
|
#unique_id = tuple(i_seq[x] for x in categories) + (seq_col.get_line_idx(i),) # The line that cython can't read properly
|
||||||
|
|
||||||
if unique_id in uniques:
|
if unique_id in uniques:
|
||||||
|
16
src/obiavl.c
16
src/obiavl.c
@ -2259,7 +2259,13 @@ index_t obi_avl_add(OBIDMS_avl_p avl, Obi_blob_p value)
|
|||||||
parent = next;
|
parent = next;
|
||||||
|
|
||||||
// Compare the crc of the value with the crc of the current node
|
// Compare the crc of the value with the crc of the current node
|
||||||
comp = (current_node->crc64) - crc;
|
//comp = (current_node->crc64) - crc;
|
||||||
|
if ((current_node->crc64) == crc)
|
||||||
|
comp = 0;
|
||||||
|
else if ((current_node->crc64) > crc)
|
||||||
|
comp = 1;
|
||||||
|
else
|
||||||
|
comp = -1;
|
||||||
|
|
||||||
if (comp == 0)
|
if (comp == 0)
|
||||||
{ // check if really same value
|
{ // check if really same value
|
||||||
@ -2354,7 +2360,13 @@ index_t obi_avl_find(OBIDMS_avl_p avl, Obi_blob_p value)
|
|||||||
current_node = (avl->tree)+next;
|
current_node = (avl->tree)+next;
|
||||||
|
|
||||||
// Compare the crc of the value with the crc of the current node
|
// Compare the crc of the value with the crc of the current node
|
||||||
comp = (current_node->crc64) - crc;
|
//comp = (current_node->crc64) - crc;
|
||||||
|
if ((current_node->crc64) == crc)
|
||||||
|
comp = 0;
|
||||||
|
else if ((current_node->crc64) > crc)
|
||||||
|
comp = 1;
|
||||||
|
else
|
||||||
|
comp = -1;
|
||||||
|
|
||||||
if (comp == 0)
|
if (comp == 0)
|
||||||
{ // Check if really same value
|
{ // Check if really same value
|
||||||
|
Reference in New Issue
Block a user