From 0894b608d10b44028750dc98090cd8f24a14c408 Mon Sep 17 00:00:00 2001 From: John Tramm Date: Thu, 23 Jan 2020 18:36:05 +0000 Subject: [PATCH] A few changes to the sharedarray object. --- include/openmc/shared_array.h | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/include/openmc/shared_array.h b/include/openmc/shared_array.h index d0deafec6e..872621ece2 100644 --- a/include/openmc/shared_array.h +++ b/include/openmc/shared_array.h @@ -17,18 +17,14 @@ private: //========================================================================== // Data members std::unique_ptr data_; - int64_t size_; - int64_t capacity_; + int64_t size_ {0}; + int64_t capacity_ {0}; public: //========================================================================== // Constructors - SharedArray() - { - capacity_ = 0; - size_ = 0; - } + SharedArray() = default; SharedArray(int64_t capacity) : capacity_(capacity) { @@ -73,18 +69,9 @@ public: capacity_ = 0; } - int64_t size() - { - int size; - #pragma omp atomic read - size = size_; - return size; - } + int64_t size() {return size_;} - int64_t capacity() - { - return capacity_; - } + int64_t capacity() {return capacity_;} };