Skip to content

Commit

Permalink
API: make addSpecialConfigValue take a ref to val
Browse files Browse the repository at this point in the history
woo breaking API and ABI
  • Loading branch information
vaxerski committed Feb 13, 2024
1 parent a3b1a6b commit ebffe8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions include/hyprlang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,13 @@ namespace Hyprlang {
void removeSpecialCategory(const char* name);

/*!
\since 0.3.0
\since 0.3.2
Add a config value to a special category.
\note Before 0.3.2, this takes a `const CConfigValue` (non-ref)
*/
void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value);
void addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value);

/*!
Remove a config value from a special category.
Expand Down
2 changes: 1 addition & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void CConfig::addConfigValue(const char* name, const CConfigValue& value) {
reinterpret_cast<CConfigCustomValueType*>(value.m_pData)->dtor});
}

void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue value) {
void CConfig::addSpecialConfigValue(const char* cat, const char* name, const CConfigValue& value) {
const auto IT = std::find_if(impl->specialCategoryDescriptors.begin(), impl->specialCategoryDescriptors.end(), [&](const auto& other) { return other->name == cat; });

if (IT == impl->specialCategoryDescriptors.end())
Expand Down

0 comments on commit ebffe8f

Please sign in to comment.