mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-28 16:34:49 +08:00
Fabric: Using small_vector instead of regular vector in some hot code paths
Summary: The hope is that it will remove many unnececery allocations improving overal perfromance. Reviewed By: mdvacca Differential Revision: D14249198 fbshipit-source-id: f0442b3919ccead0582a3190dea0e33d517d85f6
This commit is contained in:
committed by
Facebook Github Bot
parent
c3ecae0db4
commit
2862ef3a47
@@ -70,7 +70,7 @@ void AttributedString::prependAttributedString(
|
||||
attributedString.fragments_.end());
|
||||
}
|
||||
|
||||
const std::vector<Fragment> &AttributedString::getFragments() const {
|
||||
const Fragments &AttributedString::getFragments() const {
|
||||
return fragments_;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class AttributedString : public Sealable, public DebugStringConvertible {
|
||||
bool operator!=(const Fragment &rhs) const;
|
||||
};
|
||||
|
||||
using Fragments = std::vector<Fragment>;
|
||||
using Fragments = better::small_vector<Fragment, 1>;
|
||||
|
||||
/*
|
||||
* Appends and prepends a `fragment` to the string.
|
||||
|
||||
Reference in New Issue
Block a user