From 2f3e4e24140493a96a7ece89429d294546a9e0c0 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 8 May 2012 23:45:00 -0700 Subject: [PATCH] model: change constructor assignments to initializer list Apparently this is a nice C++ feature I didn't know of. Not much use here, but there will be other uses... --- model.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/model.cc b/model.cc index 53411c6..142e862 100644 --- a/model.cc +++ b/model.cc @@ -39,21 +39,21 @@ void free_action_list(action_list_t *list) } ModelChecker::ModelChecker() -{ - /* First thread created will have id INITIAL_THREAD_ID */ - next_thread_id = INITIAL_THREAD_ID; - used_sequence_numbers = 0; + : /* Initialize default scheduler */ - scheduler = new Scheduler(); - - num_executions = 0; - current_action = NULL; - exploring = NULL; - nextThread = THREAD_ID_T_NONE; - - rootNode = new TreeNode(); - currentNode = rootNode; - action_trace = new action_list_t(); + scheduler(new Scheduler()), + /* First thread created will have id INITIAL_THREAD_ID */ + next_thread_id(INITIAL_THREAD_ID), + used_sequence_numbers(0), + + num_executions(0), + current_action(NULL), + exploring(NULL), + nextThread(THREAD_ID_T_NONE), + action_trace(new action_list_t()), + rootNode(new TreeNode()), + currentNode(rootNode) +{ } ModelChecker::~ModelChecker() -- 2.34.1