Skip to content

Commit

Permalink
One more attempt to decrease flash usage by less instantiation of things
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Dec 18, 2024
1 parent 3d41548 commit 27b9ca0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ CodegenDataModelProvider::GetDeviceTypes(EndpointId endpointId)
std::optional<unsigned> endpoint_index = TryFindEndpointIndex(endpointId);
if (!endpoint_index.has_value())
{
return std::make_unique<DataModel::NullElementIterator<DataModel::DeviceTypeEntry>>();
// do not use the NULL iterator to save flash on what classs are instantiated
return std::make_unique<DeviceTypeEntryIterator>(Span<EmberAfDeviceType>());
}

CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down

0 comments on commit 27b9ca0

Please sign in to comment.