mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
83405ff316
commit
56a416e3be
@@ -90,13 +90,13 @@ folly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name)
|
||||
|
||||
if (it == modulesByName_.end()) {
|
||||
if (unknownModules_.find(name) != unknownModules_.end()) {
|
||||
return nullptr;
|
||||
return folly::none;
|
||||
}
|
||||
if (!moduleNotFoundCallback_ ||
|
||||
!moduleNotFoundCallback_(name) ||
|
||||
(it = modulesByName_.find(name)) == modulesByName_.end()) {
|
||||
unknownModules_.insert(name);
|
||||
return nullptr;
|
||||
return folly::none;
|
||||
}
|
||||
}
|
||||
size_t index = it->second;
|
||||
@@ -143,7 +143,7 @@ folly::Optional<ModuleConfig> ModuleRegistry::getConfig(const std::string& name)
|
||||
|
||||
if (config.size() == 2 && config[1].empty()) {
|
||||
// no constants or methods
|
||||
return nullptr;
|
||||
return folly::none;
|
||||
} else {
|
||||
return ModuleConfig{index, config};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user