diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2021-03-15 22:56:51 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-19 05:54:14 +0000 |
commit | b0e48211b3cbda845bd18c3283fe0d5f5dcd98c6 (patch) | |
tree | da67a68169b9c3b73c7a97b6af0f2c3321281bf7 /src/mongo/db/pipeline/expression.cpp | |
parent | 612a3725d98381bf9c0777bcd6b2169cae33f4d1 (diff) | |
download | mongo-b0e48211b3cbda845bd18c3283fe0d5f5dcd98c6.tar.gz |
SERVER-55180 Convert SBE from std::string_view to StringData
Remove implicit StringData <=> string_view conversions
Diffstat (limited to 'src/mongo/db/pipeline/expression.cpp')
-rw-r--r-- | src/mongo/db/pipeline/expression.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 0db59301a5c..f008c6e7b4c 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -1972,12 +1972,8 @@ TimeUnit ExpressionDateDiff::convertToTimeUnit(const Value& value) { str::stream() << "$dateDiff requires 'unit' to be a string, but got " << typeName(value.getType()), BSONType::String == value.getType()); - auto valueAsString = value.getStringData(); - return addContextToAssertionException( - [&]() { - return parseTimeUnit(std::string_view{valueAsString.rawData(), valueAsString.size()}); - }, - "$dateDiff parameter 'unit' value parsing failed"_sd); + return addContextToAssertionException([&] { return parseTimeUnit(value.getStringData()); }, + "$dateDiff parameter 'unit' value parsing failed"_sd); } DayOfWeek ExpressionDateDiff::parseStartOfWeek(const Value& value) { @@ -1985,11 +1981,8 @@ DayOfWeek ExpressionDateDiff::parseStartOfWeek(const Value& value) { str::stream() << "$dateDiff requires 'startOfWeek' to be a string, but got " << typeName(value.getType()), BSONType::String == value.getType()); - auto valueAsString = value.getStringData(); return addContextToAssertionException( - [&]() { - return parseDayOfWeek(std::string_view{valueAsString.rawData(), valueAsString.size()}); - }, + [&] { return parseDayOfWeek(value.getStringData()); }, "$dateDiff parameter 'startOfWeek' value parsing failed"_sd); } |