Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix minor codecov
  • Loading branch information
PeterChen13579 committed Jul 15, 2024
commit ce51e8569afeda0aa7fe52bd11a20fb0aa94998c
6 changes: 2 additions & 4 deletions src/util/newconfig/ConfigDefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ struct ClioConfigDescription {
auto const itr = std::find_if(configDescription.begin(), configDescription.end(), [&key](auto const& v) {
return v.key == key;
});
if (itr != configDescription.end()) {
return itr->value;
}
return "Not Found";
ASSERT(itr != configDescription.end(), "key doesn't exist in config");
return itr->value;
}

private:
Expand Down
18 changes: 9 additions & 9 deletions src/util/newconfig/ObjectView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ class ObjectView {
bool
containsKey(std::string_view key) const;

/**
* @brief Checks if any key in ClioConfigDefinition starts with prefix_.key
*
* @param key The suffix of the key
* @return true if at least one key starts with the specified prefix_.key, otherwise false
*/
bool
startsWithKey(std::string_view key) const;

/**
* @brief Retrieves the value associated with the specified prefix._key in ClioConfigDefinition
*
Expand Down Expand Up @@ -105,6 +96,15 @@ class ObjectView {
std::string
getFullKey(std::string_view key) const;

/**
* @brief Checks if any key in ClioConfigDefinition starts with prefix_.key
*
* @param key The suffix of the key
* @return true if at least one key starts with the specified prefix_.key, otherwise false
*/
bool
startsWithKey(std::string_view key) const;

std::string prefix_;
std::optional<size_t> arrayIndex_;
ClioConfigDefinition const& clioConfig_;
Expand Down