From a16bd28284af25652c49a1526f963212e99e2a39 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 15 Mar 2023 12:30:02 -0700 Subject: [PATCH] Move port_masked variable inside #else block --- src/Val.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Val.cc b/src/Val.cc index 03f33d5e11..208c564bf6 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -3998,10 +3998,11 @@ const PortValPtr& ValManager::Port(uint32_t port_num, TransportProto port_type) port_num = 0; } - auto port_masked = PortVal::Mask(port_num, port_type); #ifdef PREALLOCATE_PORT_ARRAY return ports[port_type][port_num]; #else + auto port_masked = PortVal::Mask(port_num, port_type); + if ( ports.count(port_masked) == 0 ) ports.insert({port_masked, make_intrusive(port_masked)});