Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad40d6dd authored by Chris Manton's avatar Chris Manton
Browse files

acl_manager: Contextual callbacks are never empty

No need to check for them being empty

Bug: 331463662
Test: m .
Flag: EXEMPT, Mechanical refactor
Change-Id: Ie5716060fd5772cca185ba77ce77fa9379fab71b
parent 94544dff
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ struct AclScheduler::impl {
      if (entry != nullptr && entry->address == address) {
        // If so, clear the current entry and advance the queue
        outgoing_entry_.reset();
        handle_outgoing_connection.InvokeIfNotEmpty();
        handle_outgoing_connection.Invoke();
        try_dequeue_next_operation();
        return;
      }
@@ -70,9 +70,9 @@ struct AclScheduler::impl {
    // Otherwise check if it's an incoming request and advance the queue if so
    if (incoming_connecting_address_set_.find(address) != incoming_connecting_address_set_.end()) {
      incoming_connecting_address_set_.erase(address);
      handle_incoming_connection.InvokeIfNotEmpty();
      handle_incoming_connection.Invoke();
    } else {
      handle_unknown_connection.InvokeIfNotEmpty(set_of_incoming_connecting_addresses());
      handle_unknown_connection.Invoke(set_of_incoming_connecting_addresses());
    }
    try_dequeue_next_operation();
  }
+3 −3
Original line number Diff line number Diff line
@@ -129,14 +129,14 @@ class MockAclScheduler : public AclScheduler {
      common::ContextualOnceCallback<void()> handle_incoming_connection,
      common::ContextualOnceCallback<void(std::string)> handle_unknown_connection) override {
    if (handle_outgoing_connection_) {
      handle_outgoing_connection.InvokeIfNotEmpty();
      handle_outgoing_connection.Invoke();
      return;
    }

    if (handle_incoming_connection_) {
      handle_incoming_connection.InvokeIfNotEmpty();
      handle_incoming_connection.Invoke();
    } else {
      handle_unknown_connection.InvokeIfNotEmpty("set_of_incoming_connecting_addresses()");
      handle_unknown_connection.Invoke("set_of_incoming_connecting_addresses()");
    }
  }
};