Skip to content

Commit bac34cc

Browse files
committed
rvalue perhaps
1 parent 116fd83 commit bac34cc

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

include/Horrible.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include <cocos2d.h>
2020

21+
#include <Geode/Result.hpp>
22+
2123
#include <Geode/utils/function.hpp>
2224
#include <Geode/utils/StringMap.hpp>
2325
#include <Geode/utils/ZStringView.hpp>
@@ -70,7 +72,7 @@ namespace horrible {
7072
* @param id The ID of the option to set the delegate for
7173
* @param callback The hook callback to register for this option's delegate
7274
*/
73-
void addDelegate(std::string id, geode::Function<void(bool)>&& callback);
75+
void addDelegate(std::string&& id, geode::Function<void(bool)>&& callback);
7476

7577
/**
7678
* Returns a reference to the array of all registered options

include/OptionalAPI.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "Horrible.hpp"
44

5+
#include <Geode/Result.hpp>
6+
57
#include <Geode/loader/Event.hpp>
68
#include <Geode/loader/Dispatch.hpp>
79

src/include/Horrible.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ void OptionManager::registerOption(Option option) {
3030
};
3131
};
3232

33-
void OptionManager::addDelegate(std::string id, Function<void(bool)>&& callback) {
33+
void OptionManager::addDelegate(std::string&& id, Function<void(bool)>&& callback) {
3434
auto& thisDelegate = m_delegates[std::move(id)];
3535
thisDelegate.push_back(std::move(callback));
36-
37-
log::debug("Added delegate for option {} ({} total)", id, thisDelegate.size());
3836
};
3937

4038
std::span<const Option> OptionManager::getOptions() const noexcept {

src/menu/src/OptionMenu.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ void OptionMenu::resetFilters(CCObject*) {
315315
m_impl->selectedTier = SillyTier::None;
316316
CategoryEvent().send("", false);
317317
};
318-
});
318+
}
319+
);
319320
};
320321

321322
void OptionMenu::openModSettings(CCObject*) {

0 commit comments

Comments
 (0)