LOG(ERROR) << "Failed to connect database";
return PMINFO_R_ERROR;
}
- GList* list = nullptr;
- std::vector<std::pair<sqlite3*, uid_t>> conn_list = GetConnection();
+
+ const auto& conn_list = GetConnection();
int ret = PMINFO_R_OK;
- for (auto& conn : conn_list) {
- ret = pkginfo_internal_filter_get_depends_on(
- conn.first, pkgid_.c_str(), &list);
+ dependency_list_.clear();
+ for (const auto& conn : conn_list) {
+ ret = internal::GetDependsOn(conn.first, pkgid_, dependency_list_);
if (ret == PMINFO_R_ERROR)
break;
}
- for (GList* tmp = list; tmp; tmp = tmp->next)
- dependency_list_.emplace_back(reinterpret_cast<dependency_x *>(tmp->data));
-
- g_list_free(list);
-
return ret;
}