refactor: improve and make more efficient some Message API (#432)

This commit is contained in:
Stanislav Angelovič
2024-04-24 20:20:29 +02:00
parent ef552ec089
commit 310161207a
9 changed files with 58 additions and 67 deletions
+1 -5
View File
@@ -300,8 +300,6 @@ const Object::VTable::MethodItem* Object::findMethod(const VTable& vtable, std::
return methodItem.name < methodName;
});
(void)it;
return it != vtable.methods.end() && it->name == methodName ? &*it : nullptr;
}
@@ -312,8 +310,6 @@ const Object::VTable::PropertyItem* Object::findProperty(const VTable& vtable, s
return propertyItem.name < propertyName;
});
(void)it;
return it != vtable.properties.end() && it->name == propertyName ? &*it : nullptr;
}
@@ -333,7 +329,7 @@ int Object::sdbus_method_callback(sd_bus_message *sdbusMessage, void *userData,
auto message = Message::Factory::create<MethodCall>(sdbusMessage, &vtable->object->connection_.getSdBusInterface());
const auto* methodItem = findMethod(*vtable, message.getMemberName()); // TODO: optimize the situation around getMemberName()
const auto* methodItem = findMethod(*vtable, message.getMemberName());
assert(methodItem != nullptr);
assert(methodItem->callback);