Skip to content

Commit 3f0f544

Browse files
important folly::split usage fix (#1962)
Summary: Pull Request resolved: #1962 While looking through folly::split usages in the codebase saw this one. It's quite heavy. Reviewed By: dmm-fb Differential Revision: D44414708 fbshipit-source-id: 6bc9e7e8c27ed27ee347cd640b4dfa31de8baa6b
1 parent 9d72edd commit 3f0f544

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

folly/IPAddress.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include <folly/String.h>
2727
#include <folly/detail/IPAddressSource.h>
28+
#include <folly/small_vector.h>
2829

2930
using std::ostream;
3031
using std::string;
@@ -70,11 +71,13 @@ IPAddressV6 IPAddress::createIPv6(const IPAddress& addr) {
7071
}
7172

7273
namespace {
73-
vector<string> splitIpSlashCidr(StringPiece ipSlashCidr) {
74-
vector<string> vec;
75-
split("/", ipSlashCidr, vec);
74+
75+
auto splitIpSlashCidr(StringPiece ipSlashCidr) {
76+
folly::small_vector<folly::StringPiece, 2> vec;
77+
folly::split('/', ipSlashCidr, vec);
7678
return vec;
7779
}
80+
7881
} // namespace
7982

8083
// public static

0 commit comments

Comments
 (0)