[Coverity] Fix Coverity issue
authorDonghak PARK <donghak.park@samsung.com>
Tue, 29 Aug 2023 08:00:38 +0000 (17:00 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 20 Sep 2023 06:48:51 +0000 (15:48 +0900)
Fix Coverity issue : auto_causes_copy issue

Signed-off-by: Donghak PARK <donghak.park@samsung.com>
Applications/Android/ResnetJNI/app/src/main/jni/dataloader.cpp

index b28bb67..0406da1 100644 (file)
@@ -188,7 +188,7 @@ DirDataLoader::DirDataLoader(const char *directory_, float split_ratio,
   unsigned int num_data_total = 0;
   unsigned int num_data = 1;
 
-  for (auto c_name : class_names) {
+  for (auto &c_name : class_names) {
     num_data = 0;
     std::filesystem::directory_iterator itr(c_name);
     while (itr != std::filesystem::end(itr)) {