From ba9d07f0030fc81d4686f551db735b8f44c302e3 Mon Sep 17 00:00:00 2001 From: Shinobu Kinjo Date: Thu, 21 Dec 2017 22:42:28 -0500 Subject: [PATCH] common: cleanup address_helper Signed-off-by: Shinobu Kinjo --- src/common/address_helper.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/address_helper.cc b/src/common/address_helper.cc index 09ec805bce27a..7ea9701e142ee 100644 --- a/src/common/address_helper.cc +++ b/src/common/address_helper.cc @@ -1,3 +1,5 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab /* * address_helper.cc * @@ -15,7 +17,6 @@ int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url) { using namespace boost; - using std::endl; regex expr("(tcp|rdma)://([^:]*):([\\d]+)"); cmatch m; @@ -27,8 +28,7 @@ int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; addrinfo *res; - int error = getaddrinfo(host.c_str(), NULL, &hints, &res); - if (! error) { + if (!getaddrinfo(host.c_str(), nullptr, &hints, &res)) { addr->set_sockaddr((sockaddr*)res->ai_addr); addr->set_port(std::atoi(port.c_str())); freeaddrinfo(res); -- 2.47.3