-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Absl string view to std string in dynamic metadata #4078
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
Conversation
Signed-off-by: Henna Huang <henna@google.com>
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.
sigh
@@ -6,7 +6,7 @@ namespace Envoy { | |||
namespace RequestInfo { | |||
|
|||
void DynamicMetadataImpl::setData(absl::string_view data_name, std::unique_ptr<Object>&& data) { | |||
if (data_storage_.find(data_name) != data_storage_.end()) { | |||
if (data_storage_.find(std::string(data_name)) != data_storage_.end()) { |
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.
Please leave TODOs at each site to cleanup when we have full C++14 compliance.
Signed-off-by: Henna Huang <henna@google.com>
@@ -6,7 +6,8 @@ namespace Envoy { | |||
namespace RequestInfo { | |||
|
|||
void DynamicMetadataImpl::setData(absl::string_view data_name, std::unique_ptr<Object>&& data) { | |||
if (data_storage_.find(data_name) != data_storage_.end()) { | |||
// TODO(Google): Remove string conversion when fixed internally. | |||
if (data_storage_.find(std::string(data_name)) != data_storage_.end()) { |
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.
this function does same conversion 5 lines below, have a variable to store it?
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.
Done.
Signed-off-by: Henna Huang <henna@google.com>
Signed-off-by: Henna Huang henna@google.com
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Description: Convert absl string_view to std::string in the dynamic metadata library. This is needed for the Google import.
Risk Level: Low
Testing: Existing tests
Docs Changes: N/A
Release Notes: N/A
[Optional Fixes #Issue]
[Optional Deprecated:]