Commit 2b546a7a authored by Nathan Bronson's avatar Nathan Bronson Committed by Facebook Github Bot

add missing FOLLY_ALWAYS_INLINE to F14Map erase

Summary:
F14Map::erase(it) returns ++it for compatibility, but it
is often discarded. erase(const_iterator) was marked always-inline to
enable the computation of the return value to be optimized away, but the
annotation was missing from erase(iterator).  This also adds always-inline
annotations to a couple more methods that participate in the optimization,
but they are very good candidates for inlining regardless.

Reviewed By: yfeldblum

Differential Revision: D14854278

fbshipit-source-id: ad686b2dc8996b6a7c7038653a7c9ea1567e554d
parent b49e3a58
...@@ -688,7 +688,7 @@ class F14BasicMap { ...@@ -688,7 +688,7 @@ class F14BasicMap {
// This form avoids ambiguity when key_type has a templated constructor // This form avoids ambiguity when key_type has a templated constructor
// that accepts const_iterator // that accepts const_iterator
iterator erase(iterator pos) { FOLLY_ALWAYS_INLINE iterator erase(iterator pos) {
auto itemPos = table_.unwrapIter(pos); auto itemPos = table_.unwrapIter(pos);
table_.eraseIter(itemPos); table_.eraseIter(itemPos);
itemPos.advanceLikelyDead(); itemPos.advanceLikelyDead();
......
...@@ -641,7 +641,7 @@ class ValueContainerPolicy : public BasePolicy< ...@@ -641,7 +641,7 @@ class ValueContainerPolicy : public BasePolicy<
//////// F14BasicMap/Set policy //////// F14BasicMap/Set policy
Iter makeIter(ItemIter const& underlying) const { FOLLY_ALWAYS_INLINE Iter makeIter(ItemIter const& underlying) const {
return Iter{underlying}; return Iter{underlying};
} }
ConstIter makeConstIter(ItemIter const& underlying) const { ConstIter makeConstIter(ItemIter const& underlying) const {
...@@ -876,7 +876,7 @@ class NodeContainerPolicy ...@@ -876,7 +876,7 @@ class NodeContainerPolicy
//////// F14BasicMap/Set policy //////// F14BasicMap/Set policy
Iter makeIter(ItemIter const& underlying) const { FOLLY_ALWAYS_INLINE Iter makeIter(ItemIter const& underlying) const {
return Iter{underlying}; return Iter{underlying};
} }
ConstIter makeConstIter(ItemIter const& underlying) const { ConstIter makeConstIter(ItemIter const& underlying) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment