summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2019-08-22 08:24:32 +0200
committerGitHub <noreply@github.com>2019-08-22 08:24:32 +0200
commitb34cbdc1fc9b3356e77fb0ef04623f869c79cf4f (patch)
tree28b03cdecdce26f7958a5667c35f3ccb633a8e83
parent69bca4721b8f5539ab448f23f081c8a8564505c7 (diff)
parent301db9b9fa108339c74dc3936fbeaa779963ae24 (diff)
downloadATCD-b34cbdc1fc9b3356e77fb0ef04623f869c79cf4f.tar.gz
Merge pull request #949 from mgrojo/fragments_cleanup_strategy_optimization
Optimization: avoid invoking gettimeofday in each loop cycle
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp
index d104c0691ba..456032c58ab 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/Fragments_Cleanup_Strategy.cpp
@@ -79,6 +79,10 @@ namespace TAO_PG
TAO_UIPMC_Mcast_Transport::Packets_Map &packets
)
{
+ // bound_ is in milliseconds.
+ ACE_Time_Value const delay (0, 1000 * this->bound_);
+ ACE_Time_Value const now = ACE_OS::gettimeofday ();
+
for (HASH_MAP_ITER iter = packets.begin ();
iter != packets.end ();)
{
@@ -87,10 +91,6 @@ namespace TAO_PG
// to removed entry.
HASH_MAP_ITER cur_iter = iter++;
- // bound_ is in milliseconds.
- ACE_Time_Value const delay (0, 1000 * this->bound_);
- ACE_Time_Value const now = ACE_OS::gettimeofday ();
-
if ((*cur_iter).item ()->started () != ACE_Time_Value::zero &&
now <= (*cur_iter).item ()->started () + delay)
continue;