SolidWallOfCode commented on a change in pull request #7606:
URL: https://github.com/apache/trafficserver/pull/7606#discussion_r602546817
##########
File path: proxy/ControlBase.cc
##########
@@ -459,8 +458,7 @@ MultiTextMod::set(char *value)
Tokenizer rangeTok(",");
int num_tok = rangeTok.Initialize(value, SHARE_TOKS);
for (int i = 0; i < num_tok; i++) {
- ts::Buffer text;
- text.set(ats_strdup(rangeTok[i]), strlen(rangeTok[i]));
+ std::string_view text = std::string_view(ats_strdup(rangeTok[i]),
strlen(rangeTok[i]));
Review comment:
This is an excellent case for using `TextView` instead of `string_view`
so the parsing can be done without the need for `Tokenizer` and the attendant
memory allocation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]