Skip to content

Commit

Permalink
modules: Simplify finding whether profile is default in module list
Browse files Browse the repository at this point in the history
  • Loading branch information
pkratoch authored and j-mracek committed Oct 27, 2023
1 parent 615ad48 commit 13f6559
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions include/libdnf5-cli/output/modulelist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,9 @@ void print_modulelist_table(Query & module_list) {

// Get profile strings (append [d] or [i] if needed)
std::vector<std::string> profile_strings;
const auto & default_profiles = module_item.get_default_profiles();
for (const auto & profile : module_item.get_profiles()) {
// TODO(pkratoch): Also show "[i]" for installed profiles
const auto & name = profile.get_name();
profile_strings.push_back(
std::find(default_profiles.begin(), default_profiles.end(), name) != default_profiles.end()
? name + " [d]"
: name);
profile_strings.push_back(profile.is_default() ? profile.get_name() + " [d]" : profile.get_name());
}

add_line_into_modulelist_table(
Expand Down

0 comments on commit 13f6559

Please sign in to comment.