action: use constructor initializer list
[model-checker.git] / action.cc
index d5131f0b03dfc9c7c9b86c901ca4215fbfac8245..f41b0eba7643e18a912b776c71470eddf71a1bf7 100644 (file)
--- 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()