summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2017-06-22 19:39:12 +0000
committerSara Golemon <sara.golemon@mongodb.com>2017-06-29 14:48:26 -0400
commit35d65ae602e38afe7a4f0046ce3fb107ac38c0f0 (patch)
tree07d39b2e00b8a95b5bb5f2cb283226518ead9cc3 /src/mongo/db
parent2b5259a7a1a7b2a877ed2bb7045ddd559cd3283e (diff)
downloadmongo-35d65ae602e38afe7a4f0046ce3fb107ac38c0f0.tar.gz
SERVER-29856 Use StringData instead of std::string in CIDR/AddressRestriction<T>
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/auth/address_restriction.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/auth/address_restriction.h b/src/mongo/db/auth/address_restriction.h
index 4f96c4f21df..66b1dce1026 100644
--- a/src/mongo/db/auth/address_restriction.h
+++ b/src/mongo/db/auth/address_restriction.h
@@ -68,7 +68,7 @@ public:
/**
* Construct an AddressRestriction based on a human readable subnet spec
*/
- explicit AddressRestriction(const std::string& cidr) : _cidr(CIDR(cidr)) {}
+ explicit AddressRestriction(const StringData cidr) : _cidr(CIDR(cidr)) {}
/**
* If the given BSONElement represents a valid CIDR range,
@@ -88,7 +88,7 @@ public:
* constructs and returns the AddressRestriction.
* Otherwise returns an error.
*/
- static StatusWith<AddressRestriction<T>> parse(const std::string& from) noexcept {
+ static StatusWith<AddressRestriction<T>> parse(StringData from) noexcept {
auto cidr = CIDR::parse(from);
if (cidr.isOK()) {
return AddressRestriction<T>(std::move(cidr.getValue()));