mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert D19965405: Fabric: Small improvements in Differentiator/TinyMap
Differential Revision: D19965405 Original commit changeset: 92eedf38d55b fbshipit-source-id: 92073ca877899e2a607f283275f0d7c894dd4720
This commit is contained in:
committed by
Facebook Github Bot
parent
884c86ae02
commit
b8c17dd7c0
@@ -45,11 +45,11 @@ class TinyMap final {
|
||||
using Iterator = Pair *;
|
||||
|
||||
inline Iterator begin() {
|
||||
return &vector_.front();
|
||||
return (Pair *)vector_;
|
||||
}
|
||||
|
||||
inline Iterator end() {
|
||||
return &vector_.back() + 1;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline Iterator find(KeyT key) {
|
||||
@@ -68,8 +68,11 @@ class TinyMap final {
|
||||
}
|
||||
|
||||
inline void erase(Iterator iterator) {
|
||||
*iterator = vector_.at(vector_.size() - 1);
|
||||
vector_.pop_back();
|
||||
static_assert(
|
||||
std::is_same<KeyT, Tag>::value,
|
||||
"The collection is designed to store only `Tag`s as keys.");
|
||||
// Zero is a invalid tag.
|
||||
iterator->first = 0;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user