Move node() == nullptr check into //aos:configuration
This simplifies the code surprisingly significantly for dealing with
single node systems.
Change-Id: Ib317e16a9055fbf1341a194120a5b34f05b2d8f8
diff --git a/aos/events/event_loop.cc b/aos/events/event_loop.cc
index ee3365d..a370ca8 100644
--- a/aos/events/event_loop.cc
+++ b/aos/events/event_loop.cc
@@ -361,14 +361,12 @@
// Since we are using a RawSender, validity isn't checked. So check it
// ourselves.
- if (node() != nullptr) {
- if (!configuration::ChannelIsSendableOnNode(channel, node())) {
- LOG(FATAL) << "Channel { \"name\": \"/aos"
- << channel->name()->string_view() << "\", \"type\": \""
- << channel->type()->string_view()
- << "\" } is not able to be sent on this node. Check your "
- "configuration.";
- }
+ if (!configuration::ChannelIsSendableOnNode(channel, node())) {
+ LOG(FATAL) << "Channel { \"name\": \"/aos"
+ << channel->name()->string_view() << "\", \"type\": \""
+ << channel->type()->string_view()
+ << "\" } is not able to be sent on this node. Check your "
+ "configuration.";
}
CHECK(channel != nullptr) << ": Channel { \"name\": \"/aos\", \"type\": \""
<< timing::Report::GetFullyQualifiedName()