Dead shift in ConcurrentHashMapSegment
authorPhil Willoughby <philwill@fb.com>
Mon, 11 Sep 2017 19:20:45 +0000 (12:20 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 11 Sep 2017 19:40:26 +0000 (12:40 -0700)
commitd25d17e7f426bd585d5975bc184aa3c26eb6c6ae
tree45a6482243413ffcd690f351993cb77fb0719c46
parent001275d1666609257f21a88b488ae060f73551e7
Dead shift in ConcurrentHashMapSegment

Summary: Original problem detected by compiling with `-Werror,-Wunused-value`. On further inspection the only place which uses this detail class ensures that the `max_size` parameter is a power of two already, so we can discard the logic to manipulate `max_size` and put a `CHECK` clause in its place to guard against future changes to the caller that break this assumption.

Reviewed By: yfeldblum

Differential Revision: D5799110

fbshipit-source-id: d21ed9ff196d54ef91e38254df8b1b88bbf29275
folly/concurrency/ConcurrentHashMap.h
folly/concurrency/detail/ConcurrentHashMap-detail.h