DNA sequences and character strings are now handled using AVL trees.
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
#include "obitypes.h"
|
||||
#include "obierrno.h"
|
||||
#include "obidebug.h"
|
||||
#include "obiarray.h"
|
||||
#include "obiavl.h"
|
||||
|
||||
|
||||
#define DEBUG_LEVEL 0 // TODO has to be defined somewhere else (cython compil flag?)
|
||||
@ -67,8 +67,8 @@ int obi_column_set_obiseq_with_elt_idx(OBIDMS_column_p column, index_t line_nb,
|
||||
if (value_b == NULL)
|
||||
return -1;
|
||||
|
||||
// Add in the obiarray
|
||||
idx = obi_array_add(column->array, value_b);
|
||||
// Add in the AVL tree
|
||||
idx = obi_avl_add(column->avl, value_b);
|
||||
if (idx == -1)
|
||||
return -1;
|
||||
|
||||
@ -106,7 +106,7 @@ const char* obi_column_get_obiseq_with_elt_idx(OBIDMS_column_p column, index_t l
|
||||
if (idx == OBIIdx_NA)
|
||||
return "\0"; // TODO
|
||||
|
||||
value_b = obi_array_get(column->array, idx);
|
||||
value_b = obi_avl_get(column->avl, idx);
|
||||
return obi_obibytes_to_seq(value_b);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user