mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <>
Subject Review Request 64496: Avoided unnecessary work in contains checks in hashset and hashmap.
Date Mon, 11 Dec 2017 13:31:25 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for mesos and Michael Park.

Repository: mesos


In order to check whether a key or value was present in a 'hashset' or
'hashmap' we were checking whether the count for that entry was
greater than zero. In order to count elements a complete traversal of
the container is required, while a contains check already has an
answer when the first element has been found.

This patch uses find in contains check for both hashset and hashmap to
avoid the full traversal.


  3rdparty/stout/include/stout/hashmap.hpp 91085b8d8ad5d35c39c8cc95e3d4765d82d9a8db 
  3rdparty/stout/include/stout/hashset.hpp 6af209c53185207b53396e7687e3bd7357e57bf1 



`make check`


Benjamin Bannier

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message