Remove unnecessary codes
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 25 Feb 2021 03:32:41 +0000 (12:32 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 25 Feb 2021 03:32:41 +0000 (12:32 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/manager/pkginfo_manager.cc

index 952ff12..ffc696f 100644 (file)
@@ -66,11 +66,9 @@ extern "C" EXPORT_API int _pkginfo_get_packages(uid_t uid,
 
        auto result_list = return_parcel->GetPkgInfo();
        // TODO: check noentry error has returned if size of result_list is 0
-       for (auto& pkginfo : result_list) {
-               g_hash_table_insert(packages, (gpointer)pkginfo->package, (gpointer)pkginfo);
-               // TODO: remove element from list. is this work?
-               pkginfo = nullptr;      
-       }
+       for (auto& pkginfo : result_list)
+               g_hash_table_insert(packages, (gpointer)pkginfo->package, 
+                               (gpointer)pkginfo);
 
        return PMINFO_R_OK;
 }
@@ -93,11 +91,9 @@ extern "C" EXPORT_API int _appinfo_get_applications(uid_t db_uid, uid_t uid,
        tizen_base::Parcel parcel;
        parcel.ReadParcelable(return_parcel.get());
        auto result_list = return_parcel->GetAppInfo();
-       for (auto& appinfo : result_list) {
-               g_hash_table_insert(packages, (gpointer)appinfo->appid, (gpointer)appinfo);
-               // TODO: remove element from list. is this work?
-               appinfo = nullptr;      
-       }
+       for (auto& appinfo : result_list)
+               g_hash_table_insert(packages, (gpointer)appinfo->appid,
+                               (gpointer)appinfo);
 
        return PMINFO_R_OK;
 }