From 7a997e42bf9c6d6d6f151759bbaec3647b8be5b5 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 6 Jul 2012 17:21:33 -0700 Subject: [PATCH] action: use constructor initializer list --- action.cc | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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() -- 2.34.1