You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "brbzull0 (via GitHub)" <gi...@apache.org> on 2024/02/29 10:10:58 UTC
[PR] Coverity fixes. CID 1534726 , CID 1534745 [trafficserver]
brbzull0 opened a new pull request, #11111:
URL: https://github.com/apache/trafficserver/pull/11111
- CID 1534726 COPY_INSTEAD_OF_MOVE (COPY_INSTEAD_OF_MOVE)
- CID 1534745 COPY_INSTEAD_OF_MOVE (COPY_INSTEAD_OF_MOVE)
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "cmcfarlen (via GitHub)" <gi...@apache.org>.
cmcfarlen commented on PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111#issuecomment-1988655383
Cherry-picked to v10.0.x
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "serrislew (via GitHub)" <gi...@apache.org>.
serrislew commented on code in PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111#discussion_r1513556692
##########
plugins/experimental/txn_box/plugin/include/txn_box/accl_util.h:
##########
@@ -65,7 +65,7 @@ template <typename Key, typename Value> class StringTree
using self_type = Node;
using ptr_type = self_type *;
- Node(Key k, Value v, int32_t r = -1) : key{k}, value{v}, rank{r}
+ Node(Key k, Value v, int32_t r = -1) : key{std::move(k)}, value{std::move(v)}, rank{r}
Review Comment:
is it guaranteed or given that when creating a Node object that `k` and `v` will not be used anymore since its contents have now been moved instead of copied?
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "brbzull0 (via GitHub)" <gi...@apache.org>.
brbzull0 commented on code in PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111#discussion_r1514877731
##########
plugins/experimental/txn_box/plugin/include/txn_box/accl_util.h:
##########
@@ -128,7 +128,7 @@ template <typename Key, typename Value> class StringTree
/// hold the first element on the entire tree.
node_type_ptr _head;
/// this gets incremented on every insert.
- int32_t _rank_counter;
+ int32_t _rank_counter{0};
Review Comment:
it's not used, but it is there for a `design` reason. It will be used eventually.
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "brbzull0 (via GitHub)" <gi...@apache.org>.
brbzull0 merged PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111#discussion_r1514862076
##########
plugins/experimental/txn_box/plugin/include/txn_box/accl_util.h:
##########
@@ -128,7 +128,7 @@ template <typename Key, typename Value> class StringTree
/// hold the first element on the entire tree.
node_type_ptr _head;
/// this gets incremented on every insert.
- int32_t _rank_counter;
+ int32_t _rank_counter{0};
Review Comment:
Looks like all this rank stuff may just be kruft:
```
wkaras ~/REPOS/TS/plugins/experimental/txn_box
O$ grep rank $(findsrc)
./plugin/include/txn_box/accl_util.h: Node(Key k, Value v, int32_t r = -1) : key{k}, value{v}, rank{r}
./plugin/include/txn_box/accl_util.h: /// key/value rank.
./plugin/include/txn_box/accl_util.h: int32_t rank;
./plugin/include/txn_box/accl_util.h: /// TODO: this needs to be changed and use rank to return only 1 value.
./plugin/include/txn_box/accl_util.h: int32_t _rank_counter{0};
./plugin/include/txn_box/accl_util.h: // We do not set the rank now, as for the head, -1 should be ok.
./plugin/include/txn_box/accl_util.h: node_type_ptr new_node = new Node(key, value, _rank_counter++);
./plugin/include/txn_box/accl_util.h: // For now we return the entire list, we need to work on the rank to send back only one match, the best one.
wkaras ~/REPOS/TS/plugins/experimental/txn_box
O$
```
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity fixes. CID 1534726 , CID 1534745, CID1534723 [trafficserver]
Posted by "brbzull0 (via GitHub)" <gi...@apache.org>.
brbzull0 commented on code in PR #11111:
URL: https://github.com/apache/trafficserver/pull/11111#discussion_r1514875463
##########
plugins/experimental/txn_box/plugin/include/txn_box/accl_util.h:
##########
@@ -65,7 +65,7 @@ template <typename Key, typename Value> class StringTree
using self_type = Node;
using ptr_type = self_type *;
- Node(Key k, Value v, int32_t r = -1) : key{k}, value{v}, rank{r}
+ Node(Key k, Value v, int32_t r = -1) : key{std::move(k)}, value{std::move(v)}, rank{r}
Review Comment:
it should be ok, it's passed by value. It's also a `std::string_view` so if anything is moved, it will be the view only. Depending on how it's created it will be either move or copy. Thanks.
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org