-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(storage): reduce copies in InsertObject()
#11014
Changes from 5 commits
24f3952
042544f
2c2fe62
86bda97
1aead5c
ec05fbe
d0f65c8
d7ad86e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,11 +68,11 @@ CurlRequest::~CurlRequest() { | |
if (factory_) CurlHandle::ReturnToPool(*factory_, std::move(handle_)); | ||
} | ||
|
||
StatusOr<HttpResponse> CurlRequest::MakeRequest(std::string const& payload) && { | ||
StatusOr<HttpResponse> CurlRequest::MakeRequest(absl::string_view payload) && { | ||
handle_.SetOption(CURLOPT_UPLOAD, 0L); | ||
if (!payload.empty()) { | ||
handle_.SetOption(CURLOPT_POSTFIELDSIZE, payload.length()); | ||
handle_.SetOption(CURLOPT_POSTFIELDS, payload.c_str()); | ||
handle_.SetOption(CURLOPT_POSTFIELDS, payload.data()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh ... sorry I missed that. |
||
} | ||
return MakeRequestImpl(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving a
string_view
is an anti-pattern, I believe (et seq).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed (everywhere I hope).