Skip to content

Commit

Permalink
versionlock: Return const & where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
m-blaha committed Feb 7, 2024
1 parent bb0bae4 commit f969a17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/libdnf5/rpm/versionlock_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class VersionlockCondition {
std::string get_comparator_str() const { return comparator_str; }

/// Get list of errors found during parsing the entry from configuration file.
std::vector<std::string> get_errors() const { return errors; }
const std::vector<std::string> & get_errors() const { return errors; }

/// Converts the condition to "key operator value" string usable for printing.
/// @param with_errors Include also error messages for invalid entries
Expand Down Expand Up @@ -97,13 +97,13 @@ class VersionlockPackage {
void set_comment(std::string_view comment);

/// Get the list of conditions configured for the package.
std::vector<VersionlockCondition> get_conditions() const { return conditions; }
const std::vector<VersionlockCondition> & get_conditions() const { return conditions; }

/// Add a new condition for the package
void add_condition(VersionlockCondition && condition);

/// Get list of errors found during parsing the entry from configuration file.
std::vector<std::string> get_errors() const { return errors; }
const std::vector<std::string> & get_errors() const { return errors; }

/// Converts the package configuration to string usable for printing.
/// @param with_errors Include also error messages for invalid entries
Expand Down

0 comments on commit f969a17

Please sign in to comment.