From: Brian Norris Date: Sat, 7 Jul 2012 00:21:33 +0000 (-0700) Subject: action: use constructor initializer list X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=7a997e42bf9c6d6d6f151759bbaec3647b8be5b5 action: use constructor initializer list --- diff --git a/action.cc b/action.cc index d5131f0b..f41b0eba 100644 --- a/action.cc +++ b/action.cc @@ -5,19 +5,16 @@ #include "clockvector.h" #include "common.h" -ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value) +ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value) : + type(type), + order(order), + location(loc), + value(value), + cv(NULL) { Thread *t = thread_current(); - ModelAction *act = this; - - act->type = type; - act->order = order; - act->location = loc; - act->tid = t->get_id(); - act->value = value; - act->seq_number = model->get_next_seq_num(); - - cv = NULL; + this->tid = t->get_id(); + this->seq_number = model->get_next_seq_num(); } ModelAction::~ModelAction()