From b118d83f84a47a6ac778ed8ea43030d477b0bc9c Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 2 Aug 2012 10:25:17 -0700 Subject: [PATCH] more reformatting/indentation --- hashtable.h | 27 ++++++++++++++------------- model.cc | 3 +-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hashtable.h b/hashtable.h index 5d9e2d6..75d68f2 100644 --- a/hashtable.h +++ b/hashtable.h @@ -9,10 +9,10 @@ #include template - struct hashlistnode { - _Key key; - _Val val; - struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *next; +struct hashlistnode { + _Key key; + _Val val; + struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *next; void * operator new(size_t size) { return _malloc(size); @@ -29,11 +29,12 @@ template class HashTable { public: @@ -118,13 +119,13 @@ template threshold) { + if (size > threshold) { //Resize - unsigned int newsize = capacity << 1; - resize(newsize); - } + unsigned int newsize = capacity << 1; + resize(newsize); + } - struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; + struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; size++; struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *search = ptr; diff --git a/model.cc b/model.cc index 2b2a5f0..b456c24 100644 --- a/model.cc +++ b/model.cc @@ -15,8 +15,7 @@ ModelChecker *model; /** @brief Constructor */ -ModelChecker::ModelChecker() - : +ModelChecker::ModelChecker() : /* Initialize default scheduler */ scheduler(new Scheduler()), /* First thread created will have id INITIAL_THREAD_ID */ -- 2.34.1