Skip to content

Commit

Permalink
Merge pull request #2 from karasikov/master
Browse files Browse the repository at this point in the history
cleanup
  • Loading branch information
chrisbarber authored May 6, 2019
2 parents a2b26f7 + 812a157 commit 7ed75ca
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions include/internal/wt_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ namespace dyn{
ulint j=0,
ulint offset=0) {

if(Bs.size()==1){
if(Bs.size()==1){
//this node must be a leaf
assert(bv.size()==0);

Expand All @@ -483,53 +483,51 @@ namespace dyn{
make_leaf(c);
}
return;
}
}

assert(not is_leaf());
assert(not is_leaf());

bool t0 = false;
bool t1 = false;
bool task_started_0 = false;
bool task_started_1 = false;

for(ulint idx = offset; idx < values.size(); ++idx) {
auto c = values[idx];
if (!Bs.count(c))
char_type c = values[idx];
auto it = Bs.find(c);
if (it == Bs.end())
continue;

auto B = Bs[c];
bool b = it->second[j];

bool b = B[j];
bv.push_back(b);

if(b){
if(not t1){
t1 = true;
if(b && !task_started_1){
task_started_1 = true;

if(not has_child1())
if(not has_child1())
child1_ = new node(this);

map<char_type, vector<bool>> new_Bs;
for_each(Bs.begin(), Bs.end(), [&new_Bs, &j](const auto &pair) {
if (pair.second[j])
new_Bs.insert(pair);
});
#pragma omp task
child1_->push_many(std::move(new_Bs), values, j+1, idx);
}
}else{
if(not t0){
t0 = true;
map<char_type, vector<bool>> new_Bs;
for_each(Bs.begin(), Bs.end(), [&new_Bs,j](const auto &pair) {
if (pair.second[j])
new_Bs.insert(pair);
});
#pragma omp task
child1_->push_many(std::move(new_Bs), values, j+1, idx);
}

if (!b && !task_started_0){
task_started_0 = true;

if(not has_child0())
if(not has_child0())
child0_ = new node(this);

map<char_type, vector<bool>> new_Bs;
for_each(Bs.begin(), Bs.end(), [&new_Bs, &j](const auto &pair) {
if (!pair.second[j])
new_Bs.insert(pair);
});
#pragma omp task
child0_->push_many(std::move(new_Bs), values, j+1, idx);
}
map<char_type, vector<bool>> new_Bs;
for_each(Bs.begin(), Bs.end(), [&new_Bs,j](const auto &pair) {
if (!pair.second[j])
new_Bs.insert(pair);
});
#pragma omp task
child0_->push_many(std::move(new_Bs), values, j+1, idx);
}
}

Expand Down

0 comments on commit 7ed75ca

Please sign in to comment.