mirror of
https://github.com/status-im/react-native.git
synced 2025-01-24 00:09:08 +00:00
3770d4df45
Summary: @public To avoid unnecessary copying of `shared_ptr`s inside ShadowNodeFragment, now we store them as `const &` references. Reviewed By: mdvacca Differential Revision: D8988388 fbshipit-source-id: 0b3582e57ce7577b8fa819392bf33f34e1a60b59
35 lines
846 B
C++
35 lines
846 B
C++
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "ShadowNodeFragment.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
SharedProps &ShadowNodeFragment::nullSharedProps() {
|
|
static auto &instance = *new SharedProps();
|
|
return instance;
|
|
}
|
|
|
|
SharedEventEmitter &ShadowNodeFragment::nullSharedEventEmitter() {
|
|
static auto &instance = *new SharedEventEmitter();
|
|
return instance;
|
|
}
|
|
|
|
SharedShadowNodeSharedList &ShadowNodeFragment::nullSharedChildren() {
|
|
static auto &instance = *new SharedShadowNodeSharedList();
|
|
return instance;
|
|
}
|
|
|
|
SharedLocalData &ShadowNodeFragment::nullLocalData() {
|
|
static auto &instance = *new SharedLocalData();
|
|
return instance;
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|