mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-22 11:16:06 +08:00
Fabric: Unifying usage of autos
Summary: I was watching a classic magnificent talk about modern C++ by Herb Sutter and I was totally sold on double down on using `auto` in our codebase. Surprisingly, 95% of the code base already follows Herb's guidence; I just changed the last 5% to make it consistent. All those changes must work *exactly* like it was before. The talk: https://youtu.be/xnqTKD8uD64?t=28m25s Reviewed By: mdvacca Differential Revision: D9753301 fbshipit-source-id: 9629aa485a5d6e51806cc96306c297284d4f90b8
This commit is contained in:
committed by
Facebook Github Bot
parent
37d19aaae3
commit
9570d7d490
@@ -40,7 +40,7 @@ const std::vector<Fragment> &AttributedString::getFragments() const {
|
||||
}
|
||||
|
||||
std::string AttributedString::getString() const {
|
||||
std::string string;
|
||||
auto string = std::string {};
|
||||
for (const auto &fragment : fragments_) {
|
||||
string += fragment.string;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ std::string AttributedString::getString() const {
|
||||
#pragma mark - DebugStringConvertible
|
||||
|
||||
SharedDebugStringConvertibleList AttributedString::getDebugChildren() const {
|
||||
SharedDebugStringConvertibleList list = {};
|
||||
auto list = SharedDebugStringConvertibleList {};
|
||||
|
||||
for (auto &&fragment : fragments_) {
|
||||
auto propsList = fragment.textAttributes.DebugStringConvertible::getDebugProps();
|
||||
|
||||
Reference in New Issue
Block a user