Skip to content

Commit 3376218

Browse files
committed
Instance: use if with initializer
1 parent 94b0afc commit 3376218

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Instance.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ Instance::AddListener(const ListenerConfig &config)
133133
/* ask the kernel for the effective address via
134134
getsockname(), because it may have changed, e.g. if
135135
the kernel has selected a port for us */
136-
const auto local_address = listener.GetSocket().GetLocalAddress();
137-
if (local_address.IsDefined()) {
136+
if (const auto local_address = listener.GetSocket().GetLocalAddress();
137+
local_address.IsDefined()) {
138138
const char *const interface = config.interface.empty()
139139
? nullptr
140140
: config.interface.c_str();

0 commit comments

Comments
 (0)