Skip to content
Snippets Groups Projects
Commit aa4c980f authored by Mathieu Valois's avatar Mathieu Valois
Browse files

add withcount support

parent ce535e43
No related branches found
No related tags found
No related merge requests found
Pipeline #6329 passed
...@@ -79,10 +79,20 @@ int Statsgen::generate_stats() { ...@@ -79,10 +79,20 @@ int Statsgen::generate_stats() {
uint thread_id = omp_get_thread_num(); uint thread_id = omp_get_thread_num();
ifstream inputfile(filename); ifstream inputfile(filename);
string line; string line;
int nbpasswords = 1;
istringstream iss;
for(uint numline = 0; numline < nblines; ++numline){ for(uint numline = 0; numline < nblines; ++numline){
getline(inputfile, line); getline(inputfile, line);
if(withcount){
iss = istringstream(line);
iss >> nbpasswords;
iss >> line;
}
else {
nbpasswords = 1;
}
if((numline % nbThread) == thread_id){ if((numline % nbThread) == thread_id){
handle_password(line, 1, results); handle_password(line, nbpasswords, results);
#pragma omp atomic #pragma omp atomic
++processed; ++processed;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment