Commit 0971ce9f authored by Mikaël Salson's avatar Mikaël Salson

IKmerStore: Use a boolean to tell if the index has already been finished.

It prevents from finishing several times (which may cause some troubles)
parent 57eba383
......@@ -11,7 +11,10 @@ AbstractACAutomaton<Info>::AbstractACAutomaton():IKmerStore<Info>() {}
template <class Info>
void AbstractACAutomaton<Info>::finish_building() {
build_failure_functions();
if (! IKmerStore<Info>::finished_building) {
IKmerStore<Info>::finish_building();
build_failure_functions();
}
}
template<class Info>
......
......@@ -61,6 +61,7 @@ protected:
string seed ;
size_t nb_kmers_inserted;
size_t max_size_indexing;
bool finished_building;
public:
......@@ -189,6 +190,7 @@ template<class T>
IKmerStore<T>::IKmerStore() {
id = ++last_id;
refs = 0;
finished_building = false;
}
template<class T> int IKmerStore<T>::last_id = 0;
......@@ -330,7 +332,9 @@ void IKmerStore<T>::insert(const seqtype &sequence,
}
template<class T>
void IKmerStore<T>::finish_building() {}
void IKmerStore<T>::finish_building() {
finished_building = true;
}
template<class T>
float IKmerStore<T>::getIndexLoad(const T kmer) const {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment