Copilot commented on code in PR #12787:
URL: https://github.com/apache/trafficserver/pull/12787#discussion_r2684188017
##########
plugins/header_rewrite/conditions.cc:
##########
@@ -1718,11 +1718,8 @@ ConditionLastCapture::set_qualifier(const std::string &q)
void
ConditionLastCapture::append_value(std::string &s, const Resources &res)
{
- if (res.ovector_ptr && res.ovector_count > _ix) {
- int start = res.ovector[_ix * 2];
- int end = res.ovector[_ix * 2 + 1];
-
- s.append(std::string_view(res.ovector_ptr).substr(start, (end - start)));
+ if (res.matches.size() > _ix) {
+ s.append(res.matches[_ix]);
Review Comment:
Comparing int32_t (size()) with int (_ix) can lead to signed comparison
warnings. Since _ix is validated to be >= 0 in set_qualifier, consider casting
_ix to size_t or int32_t for the comparison to avoid potential warnings.
```suggestion
if (res.matches.size() > static_cast<size_t>(_ix)) {
s.append(res.matches[static_cast<size_t>(_ix)]);
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]