Fix minor issue
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 3 Mar 2021 07:35:36 +0000 (16:35 +0900)
committer김일호/Tizen Platform Lab(SR)/Engineer/삼성전자 <ilho159.kim@samsung.com>
Wed, 3 Mar 2021 10:27:40 +0000 (19:27 +0900)
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/database/query_handler.cc
src/manager/pkginfo_manager.cc

index 197b4d3..827ebf8 100644 (file)
@@ -26,7 +26,7 @@ QueryHandler::QueryHandler(uid_t uid) : AbstractDBHandler(uid), uid_(uid) {}
 QueryHandler::~QueryHandler() {}
 
 void QueryHandler::SetQuery(std::vector<std::string> query) {
-  query_ = query;
+  query_ = std::move(query);
 }
 
 std::string QueryHandler::GetString() { return std::string(); }
index 71d17da..ae40024 100644 (file)
@@ -207,7 +207,7 @@ extern "C" EXPORT_API int _appinfo_get_datacontrol_appid(
 
        query = sqlite3_mprintf("SELECT app_id FROM package_app_data_control "
                "WHERE providerid=%Q", providerid);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOGE("Out of memory");
                return PMINFO_R_ERROR;
        }
@@ -257,7 +257,7 @@ extern "C" EXPORT_API int _appinfo_get_datacontrol_trusted_info(
        query = sqlite3_mprintf(
                        "SELECT app_id, trusted FROM package_app_data_control "
                        "WHERE providerid=%Q AND type=%Q", providerid, type);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOGE("Out of memory");
                return PMINFO_R_ERROR;
        }
@@ -309,7 +309,7 @@ extern "C" EXPORT_API int _appinfo_get_datacontrol_privileges(
        query = sqlite3_mprintf(
                        "SELECT privilege FROM package_app_data_control_privilege "
                        "WHERE providerid=%Q AND type=%Q", providerid, type);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOGE("Out of memory");
                return PMINFO_R_ERROR;
        }
@@ -360,7 +360,7 @@ extern "C" EXPORT_API int _appinfo_get_appcontrol_privileges(
        query = sqlite3_mprintf(
                "SELECT app_control, privilege FROM package_app_app_control_privilege "
                "WHERE app_id=%Q", appid);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOG(ERROR) << "Out of memory";
                return PMINFO_R_ERROR;
        }
@@ -426,7 +426,7 @@ extern "C" EXPORT_API int _plugininfo_get_appids(
                        "package_plugin_info WHERE pkgid=%Q AND "
                        "plugin_type=%Q AND plugin_name=%Q",
       pkgid, plugin_type, plugin_name);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOG(ERROR) << "Out of memory";
                return PMINFO_R_ERROR;
        }
@@ -451,7 +451,7 @@ extern "C" EXPORT_API int _plugininfo_get_appids(
     return PMINFO_R_ERROR;
   }
        // result_list is vector of string vector
-       auto result_list = return_parcel->GetResult();
+       auto& result_list = return_parcel->GetResult();
        if (result_list.size() == 0)
                return PMINFO_R_ENOENT;
 
@@ -486,7 +486,7 @@ static int __convert_update_type(const char *type, pkgmgrinfo_updateinfo_update_
 static void __free_update_info(gpointer data)
 {
        updateinfo_x *update_info = (updateinfo_x *)data;
-       if (update_info == NULL)
+       if (update_info == nullptr)
                return;
 
        if (update_info->pkgid)
@@ -503,7 +503,7 @@ extern "C" EXPORT_API int _get_pkg_updateinfo(const char *pkgid,
        char *query = nullptr;
        int ret;
 
-       if (pkgid == NULL)
+       if (pkgid == nullptr)
                query = sqlite3_mprintf(
                                                "SELECT package, update_version, update_type "
                                                "FROM package_update_info");
@@ -512,7 +512,7 @@ extern "C" EXPORT_API int _get_pkg_updateinfo(const char *pkgid,
                                                "SELECT package, update_version, update_type "
                                                "FROM package_update_info WHERE package=%Q",
                                                pkgid);
-       if (query == NULL) {
+       if (query == nullptr) {
                LOG(ERROR) << "Out of memory";
                return PMINFO_R_ERROR;
        }
@@ -548,7 +548,7 @@ extern "C" EXPORT_API int _get_pkg_updateinfo(const char *pkgid,
       return PMINFO_R_ERROR;
     }
     updateinfo_x *update_info = reinterpret_cast<updateinfo_x *>(calloc(1, sizeof(updateinfo_x)));
-               if (update_info == NULL) {
+               if (update_info == nullptr) {
                        LOG(ERROR) << "Out of memory";
                        return PMINFO_R_ERROR;
                }
@@ -573,7 +573,7 @@ extern "C" EXPORT_API int _pkginfo_set_usr_installed_storage(const char *pkgid,
                INSTALL_LOCATION location, const char *external_pkg_path,
                uid_t uid)
 {
-       char *query = NULL;
+       char *query = nullptr;
        const char *location_str;
        std::vector<std::string> queries;