11/*
22# =============================================================================
3- # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
3+ # Copyright (c) 2016 - 2022 Blue Brain Project/EPFL
44#
55# See top-level LICENSE file for details.
66# =============================================================================.
@@ -135,16 +135,14 @@ NrnCoreTransferEvents* (*nrn2core_transfer_tqueue_)(int tid);
135135static std::unordered_map<int , int > type2movable;
136136static void setup_type2semantics () {
137137 if (type2movable.empty ()) {
138- for (auto & mf: corenrn.get_memb_funcs ()) {
139- size_t n_memb_func = (int ) (corenrn.get_memb_funcs ().size ());
140- for (int type = 0 ; type < n_memb_func; ++type) {
141- int * ds = corenrn.get_memb_func ((size_t ) type).dparam_semantics ;
142- if (ds) {
143- int dparam_size = corenrn.get_prop_dparam_size ()[type];
144- for (int psz = 0 ; psz < dparam_size; ++psz) {
145- if (ds[psz] == -4 ) { // netsend semantics
146- type2movable[type] = psz;
147- }
138+ std::size_t const n_memb_func{corenrn.get_memb_funcs ().size ()};
139+ for (std::size_t type = 0 ; type < n_memb_func; ++type) {
140+ int * ds{corenrn.get_memb_func (type).dparam_semantics };
141+ if (ds) {
142+ int dparam_size = corenrn.get_prop_dparam_size ()[type];
143+ for (int psz = 0 ; psz < dparam_size; ++psz) {
144+ if (ds[psz] == -4 ) { // netsend semantics
145+ type2movable[type] = psz;
148146 }
149147 }
150148 }
@@ -154,9 +152,7 @@ static void setup_type2semantics() {
154152
155153/* * Copy each thread's queue from NEURON **/
156154static void nrn2core_tqueue () {
157- if (type2movable.empty ()) {
158- setup_type2semantics (); // need type2movable for SelfEvent.
159- }
155+ setup_type2semantics (); // need type2movable for SelfEvent.
160156 for (int tid = 0 ; tid < nrn_nthread; ++tid) { // should be parallel
161157 NrnCoreTransferEvents* ncte = (*nrn2core_transfer_tqueue_)(tid);
162158 if (ncte) {
@@ -336,7 +332,6 @@ void watch_activate_clear() {
336332 // zero all the WATCH slots.
337333 Memb_list* ml = tml->ml ;
338334 int type = tml->index ;
339- int * semantics = corenrn.get_memb_func (type).dparam_semantics ;
340335 int dparam_size = corenrn.get_prop_dparam_size ()[type];
341336 // which slots are WATCH
342337 int first, last;
0 commit comments