Skip to content

Commit 6fc0de6

Browse files
committed
Make helper return string_view and constexpr
1 parent 8327bf5 commit 6fc0de6

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/software/networking/udp/network_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <arpa/inet.h>
44

5-
std::string getLoopbackInterfaceName()
5+
constexpr std::string_view getLoopbackInterfaceName()
66
{
77
#ifdef __APPLE__
88
return "lo0";

src/software/networking/udp/network_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
#include <optional>
66
#include <string>
7+
#include <string_view>
78

89
/**
910
* Get the name of the loopback network interface for the current platform.
1011
*
1112
* @return the loopback interface name for the current platform
1213
*/
13-
std::string getLoopbackInterfaceName();
14+
constexpr std::string_view getLoopbackInterfaceName();
1415

1516
/**
1617
* Given an interface, get the IP address associated with that interface

0 commit comments

Comments
 (0)