Skip to content

Commit 1e43d2b

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
remove unused argument from RawProps (facebook#41565)
Summary: Pull Request resolved: facebook#41565 changelog: [internal] this argument is never used, let's remove it. Reviewed By: christophpurrer Differential Revision: D51468580 fbshipit-source-id: aec029bc78b5490686a36ac8a5f5d0342bd28d50
1 parent 16ad818 commit 1e43d2b

File tree

6 files changed

+17
-20
lines changed

6 files changed

+17
-20
lines changed

packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewComponentDescriptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Props::Shared UnimplementedViewComponentDescriptor::cloneProps(
2929
// We have to clone `Props` object one more time to make sure that we have
3030
// an unshared (and non-`const`) copy of it which we can mutate.
3131
RawProps emptyRawProps{};
32-
emptyRawProps.parse(rawPropsParser_, context);
32+
emptyRawProps.parse(rawPropsParser_);
3333
auto unimplementedViewProps = std::make_shared<UnimplementedViewProps>(
3434
context,
3535
static_cast<const UnimplementedViewProps&>(*clonedProps),

packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor {
105105
return ShadowNodeT::defaultSharedProps();
106106
}
107107

108-
rawProps.parse(rawPropsParser_, context);
108+
rawProps.parse(rawPropsParser_);
109109

110110
// Call old-style constructor
111111
auto shadowNodeProps = ShadowNodeT::Props(context, rawProps, props);

packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ RawProps::RawProps(folly::dynamic dynamic) noexcept {
4747
dynamic_ = std::move(dynamic);
4848
}
4949

50-
void RawProps::parse(
51-
const RawPropsParser& parser,
52-
const PropsParserContext& /*unused*/) const noexcept {
50+
void RawProps::parse(const RawPropsParser& parser) const noexcept {
5351
react_native_assert(parser_ == nullptr && "A parser was already assigned.");
5452
parser_ = &parser;
5553
parser.preparse(*this);

packages/react-native/ReactCommon/react/renderer/core/RawProps.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ class RawProps final {
7070
RawProps(const RawProps& other) noexcept = delete;
7171
RawProps& operator=(const RawProps& other) noexcept = delete;
7272

73-
void parse(const RawPropsParser& parser, const PropsParserContext&)
74-
const noexcept;
73+
void parse(const RawPropsParser& parser) const noexcept;
7574

7675
/*
7776
* Deprecated. Do not use.

packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RawPropsParser final {
4646
ContextContainer contextContainer{};
4747
PropsParserContext parserContext{-1, contextContainer};
4848

49-
emptyRawProps.parse(*this, parserContext);
49+
emptyRawProps.parse(*this);
5050
PropsT(parserContext, {}, emptyRawProps);
5151
postPrepare();
5252
}

packages/react-native/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ TEST(RawPropsTest, handleProps) {
154154
const auto& raw = RawProps(folly::dynamic::object("nativeID", "abc"));
155155
auto parser = RawPropsParser();
156156
parser.prepare<Props>();
157-
raw.parse(parser, parserContext);
157+
raw.parse(parser);
158158

159159
auto props = std::make_shared<Props>(parserContext, Props(), raw);
160160

@@ -171,7 +171,7 @@ TEST(RawPropsTest, handleRawPropsSingleString) {
171171
const auto& raw = RawProps(folly::dynamic::object("nativeID", "abc"));
172172
auto parser = RawPropsParser();
173173
parser.prepare<Props>();
174-
raw.parse(parser, parserContext);
174+
raw.parse(parser);
175175

176176
std::string value = (std::string)*raw.at("nativeID", nullptr, nullptr);
177177

@@ -186,7 +186,7 @@ TEST(RawPropsTest, handleRawPropsSingleFloat) {
186186
RawProps(folly::dynamic::object("floatValue", (float)42.42));
187187
auto parser = RawPropsParser();
188188
parser.prepare<PropsSingleFloat>();
189-
raw.parse(parser, parserContext);
189+
raw.parse(parser);
190190

191191
auto value = (float)*raw.at("floatValue", nullptr, nullptr);
192192

@@ -201,7 +201,7 @@ TEST(RawPropsTest, handleRawPropsSingleDouble) {
201201
RawProps(folly::dynamic::object("doubleValue", (double)42.42));
202202
auto parser = RawPropsParser();
203203
parser.prepare<PropsSingleDouble>();
204-
raw.parse(parser, parserContext);
204+
raw.parse(parser);
205205

206206
auto value = (double)*raw.at("doubleValue", nullptr, nullptr);
207207

@@ -215,7 +215,7 @@ TEST(RawPropsTest, handleRawPropsSingleInt) {
215215
const auto& raw = RawProps(folly::dynamic::object("intValue", (int)42.42));
216216
auto parser = RawPropsParser();
217217
parser.prepare<PropsSingleInt>();
218-
raw.parse(parser, parserContext);
218+
raw.parse(parser);
219219

220220
int value = (int)*raw.at("intValue", nullptr, nullptr);
221221

@@ -229,7 +229,7 @@ TEST(RawPropsTest, handleRawPropsSingleIntGetManyTimes) {
229229
const auto& raw = RawProps(folly::dynamic::object("intValue", (int)42.42));
230230
auto parser = RawPropsParser();
231231
parser.prepare<PropsSingleInt>();
232-
raw.parse(parser, parserContext);
232+
raw.parse(parser);
233233

234234
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
235235
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
@@ -247,7 +247,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypes) {
247247

248248
auto parser = RawPropsParser();
249249
parser.prepare<PropsPrimitiveTypes>();
250-
raw.parse(parser, parserContext);
250+
raw.parse(parser);
251251

252252
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
253253
EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001);
@@ -269,7 +269,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetTwice) {
269269

270270
auto parser = RawPropsParser();
271271
parser.prepare<PropsPrimitiveTypes>();
272-
raw.parse(parser, parserContext);
272+
raw.parse(parser);
273273

274274
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
275275
EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001);
@@ -299,7 +299,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetOutOfOrder) {
299299

300300
auto parser = RawPropsParser();
301301
parser.prepare<PropsPrimitiveTypes>();
302-
raw.parse(parser, parserContext);
302+
raw.parse(parser);
303303

304304
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
305305
EXPECT_NEAR((double)*raw.at("doubleValue", nullptr, nullptr), 17.42, 0.0001);
@@ -326,7 +326,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesIncomplete) {
326326

327327
auto parser = RawPropsParser();
328328
parser.prepare<PropsPrimitiveTypes>();
329-
raw.parse(parser, parserContext);
329+
raw.parse(parser);
330330

331331
EXPECT_EQ((int)*raw.at("intValue", nullptr, nullptr), 42);
332332
EXPECT_EQ(raw.at("doubleValue", nullptr, nullptr), nullptr);
@@ -346,7 +346,7 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesIncorrectLookup) {
346346

347347
auto parser = RawPropsParser();
348348
parser.prepare<PropsPrimitiveTypes>();
349-
raw.parse(parser, parserContext);
349+
raw.parse(parser);
350350

351351
// Before D18662135, looking up an invalid key would trigger
352352
// an infinite loop. This is out of contract, so we should only
@@ -363,7 +363,7 @@ TEST(RawPropsTest, handlePropsMultiLookup) {
363363
const auto& raw = RawProps(folly::dynamic::object("floatValue", (float)10.0));
364364
auto parser = RawPropsParser();
365365
parser.prepare<PropsMultiLookup>();
366-
raw.parse(parser, parserContext);
366+
raw.parse(parser);
367367

368368
auto props = std::make_shared<PropsMultiLookup>(
369369
parserContext, PropsMultiLookup(), raw);

0 commit comments

Comments
 (0)