diff options
Diffstat (limited to 'vowpalwabbit/parser.cc')
-rw-r--r-- | vowpalwabbit/parser.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/vowpalwabbit/parser.cc b/vowpalwabbit/parser.cc index 7e80826f..2c55f0f9 100644 --- a/vowpalwabbit/parser.cc +++ b/vowpalwabbit/parser.cc @@ -746,7 +746,7 @@ void setup_example(vw& all, example* ae) ae->loss = 0.; ae->example_counter = (size_t)(all.p->parsed_examples + 1); - if ((!all.p->emptylines_separate_examples) || example_is_newline(ae)) + if ((!all.p->emptylines_separate_examples) || example_is_newline(*ae)) all.p->in_pass_counter++; ae->test_only = is_test_only(all.p->in_pass_counter, all.holdout_period, all.holdout_after, all.holdout_set_off); @@ -957,14 +957,14 @@ namespace VW{ words.delete_v(); } - void empty_example(vw& all, example* ec) + void empty_example(vw& all, example& ec) { if (all.audit || all.hash_inv) - for (unsigned char* i = ec->indices.begin; i != ec->indices.end; i++) + for (unsigned char* i = ec.indices.begin; i != ec.indices.end; i++) { for (audit_data* temp - = ec->audit_features[*i].begin; - temp != ec->audit_features[*i].end; temp++) + = ec.audit_features[*i].begin; + temp != ec.audit_features[*i].end; temp++) { if (temp->alloced) { @@ -973,19 +973,19 @@ namespace VW{ temp->alloced=false; } } - ec->audit_features[*i].erase(); + ec.audit_features[*i].erase(); } - for (unsigned char* i = ec->indices.begin; i != ec->indices.end; i++) + for (unsigned char* i = ec.indices.begin; i != ec.indices.end; i++) { - ec->atomics[*i].erase(); - ec->sum_feat_sq[*i]=0; + ec.atomics[*i].erase(); + ec.sum_feat_sq[*i]=0; } - ec->indices.erase(); - ec->tag.erase(); - ec->sorted = false; - ec->end_pass = false; + ec.indices.erase(); + ec.tag.erase(); + ec.sorted = false; + ec.end_pass = false; } void finish_example(vw& all, example* ec) @@ -995,7 +995,7 @@ namespace VW{ condition_variable_signal(&all.p->output_done); mutex_unlock(&all.p->output_lock); - empty_example(all, ec); + empty_example(all, *ec); mutex_lock(&all.p->examples_lock); assert(ec->in_use); |