Make function argument a reference, to avoid passing in struct data around (#35950)

* Make function argument a reference, to avoid passing in struct data around

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp
index 972e056..7f7b7e1 100644
--- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp
+++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp
@@ -318,7 +318,7 @@
 ///    - index == types.size()  // i.e. not found or there is no next
 ///
 /// hintWherePreviousMayBe represents a search hint where previous may exist.
-unsigned FindNextDeviceTypeIndex(Span<const EmberAfDeviceType> types, const DataModel::DeviceTypeEntry previous,
+unsigned FindNextDeviceTypeIndex(Span<const EmberAfDeviceType> types, const DataModel::DeviceTypeEntry & previous,
                                  unsigned hintWherePreviousMayBe)
 {
     if (hintWherePreviousMayBe < types.size())