Cleanup: Reduce indentation

Since the if statement is just a NULL check, returning early is simpler
and makes reading the rest of the funtion easier.
This commit is contained in:
Hans Goudey 2020-12-27 21:26:53 -06:00
parent aa64fd69e7
commit 57fe65b17e

View File

@ -82,7 +82,10 @@ static void get_instanced_data__collection(
bke::PersistentCollectionHandle collection_handle = bke::PersistentCollectionHandle collection_handle =
params.get_input<bke::PersistentCollectionHandle>("Collection"); params.get_input<bke::PersistentCollectionHandle>("Collection");
Collection *collection = params.handle_map().lookup(collection_handle); Collection *collection = params.handle_map().lookup(collection_handle);
if (collection != nullptr) { if (collection == nullptr) {
return;
}
const bool use_whole_collection = node.custom2 == 0; const bool use_whole_collection = node.custom2 == 0;
if (use_whole_collection) { if (use_whole_collection) {
InstancedData instance; InstancedData instance;
@ -118,7 +121,6 @@ static void get_instanced_data__collection(
} }
} }
} }
}
} }
static Array<std::optional<InstancedData>> get_instanced_data(const GeoNodeExecParams &params, static Array<std::optional<InstancedData>> get_instanced_data(const GeoNodeExecParams &params,