Skip to content

Commit

Permalink
Make OperationalSessionSetup a bit smaller. (#24805)
Browse files Browse the repository at this point in the history
We had two one-byte values, each of which was taking up 4-8 bytes (depending on target arch).
Putting them next to each other packs better.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jan 25, 2024
1 parent e7f506e commit e696351
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/OperationalSessionSetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate,
void OnNodeAddressResolutionFailed(const PeerId & peerId, CHIP_ERROR reason) override;

private:
enum class State
enum class State : uint8_t
{
Uninitialized, // Error state: OperationalSessionSetup is useless
NeedsAddress, // No address known, lookup not started yet.
Expand All @@ -247,10 +247,6 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate,

Transport::PeerAddress mDeviceAddress = Transport::PeerAddress::UDP(Inet::IPAddress::Any);

void MoveToState(State aTargetState);

State mState = State::Uninitialized;

SessionHolderWithDelegate mSecureSession;

Callback::CallbackDeque mConnectionSuccess;
Expand All @@ -261,8 +257,12 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate,
/// This is used when a node address is required.
chip::AddressResolve::NodeLookupHandle mAddressLookupHandle;

State mState = State::Uninitialized;

bool mPerformingAddressUpdate = false;

void MoveToState(State aTargetState);

CHIP_ERROR EstablishConnection(const ReliableMessageProtocolConfig & config);

/*
Expand Down

0 comments on commit e696351

Please sign in to comment.