Skip to content

Commit 56a416e

Browse files
chadaustinfacebook-github-bot
authored andcommitted
nullptr -> folly::none in fbobjc/xplat
Summary: In preparation for D12843022, starting using folly::none instead of nullptr to indicate an empty optional. Reviewed By: nlutsenko Differential Revision: D13052075 fbshipit-source-id: ed869f98b5fb1556bca1e01e3ac3e44ea914dc52
1 parent 83405ff commit 56a416e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ReactCommon/cxxreact/ModuleRegistry.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ folly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name)
9090

9191
if (it == modulesByName_.end()) {
9292
if (unknownModules_.find(name) != unknownModules_.end()) {
93-
return nullptr;
93+
return folly::none;
9494
}
9595
if (!moduleNotFoundCallback_ ||
9696
!moduleNotFoundCallback_(name) ||
9797
(it = modulesByName_.find(name)) == modulesByName_.end()) {
9898
unknownModules_.insert(name);
99-
return nullptr;
99+
return folly::none;
100100
}
101101
}
102102
size_t index = it->second;
@@ -143,7 +143,7 @@ folly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name)
143143

144144
if (config.size() == 2 && config[1].empty()) {
145145
// no constants or methods
146-
return nullptr;
146+
return folly::none;
147147
} else {
148148
return ModuleConfig{index, config};
149149
}

ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ folly::Optional<Object> JSINativeModules::createModule(
6565

6666
auto result = m_moduleRegistry->getConfig(name);
6767
if (!result.hasValue()) {
68-
return nullptr;
68+
return folly::none;
6969
}
7070

7171
Value moduleInfo = m_genNativeModuleJS->call(

0 commit comments

Comments
 (0)