[ox/event] Cleanup

This commit is contained in:
Gary Talent 2021-07-18 15:21:06 -05:00
parent 3a2acae093
commit 2d3602fd05

View File

@ -107,7 +107,7 @@ class Signal<Error(Args...)> {
Error disconnectObject(const void *receiver) const noexcept;
void emit(Args... args) noexcept;
void emit(Args... args) const noexcept;
Error emitCheckError(Args... args) noexcept;
};
@ -160,10 +160,10 @@ Error Signal<Error(Args...)>::disconnectSignal(const Signal<SubArgs...> *receive
}
template<class... Args>
Error Signal<Error(Args...)>::disconnectObject(const void *signal) const noexcept {
Error Signal<Error(Args...)>::disconnectObject(const void *receiver) const noexcept {
for (auto i = 0u; i < m_slots.size(); ++i) {
const auto &slot = m_slots[i];
if (slot->receiver() == signal) {
if (slot->receiver() == receiver) {
oxReturnError(m_slots.erase(i));
--i;
}
@ -172,7 +172,7 @@ Error Signal<Error(Args...)>::disconnectObject(const void *signal) const noexcep
}
template<class... Args>
void Signal<Error(Args...)>::emit(Args... args) noexcept {
void Signal<Error(Args...)>::emit(Args... args) const noexcept {
for (auto &f : m_slots) {
oxIgnoreError(f->call(args...));
}