Copilot commented on code in PR #2310:
URL:
https://github.com/apache/incubator-pegasus/pull/2310#discussion_r2476302334
##########
src/client_lib/pegasus_client_impl.cpp:
##########
@@ -1219,18 +1219,20 @@ void pegasus_client_impl::async_get_unordered_scanners(
if (err == ERR_OK) {
::dsn::unmarshall(resp, response);
if (response.err == ERR_OK) {
- unsigned int count = response.partition_count;
+ auto count = static_cast<int32_t>(response.partition_count);
int split = count < max_split_count ? count : max_split_count;
scanners.resize(split);
int size = count / split;
int more = count - size * split;
+ int partition_index = 0;
for (int i = 0; i < split; i++) {
- int s = size + (i < more);
+ int s = size + static_cast<int>(i < more);
Review Comment:
[nitpick] The explicit cast `static_cast<int>(i < more)` is unnecessary as
the boolean comparison result is already implicitly converted to int when added
to size. Consider simplifying to `int s = size + (i < more);` for better
readability.
```suggestion
int s = size + (i < more);
```
##########
src/client_lib/pegasus_client_impl.cpp:
##########
@@ -1219,18 +1219,20 @@ void pegasus_client_impl::async_get_unordered_scanners(
if (err == ERR_OK) {
::dsn::unmarshall(resp, response);
if (response.err == ERR_OK) {
- unsigned int count = response.partition_count;
+ auto count = static_cast<int32_t>(response.partition_count);
Review Comment:
[nitpick] The cast `static_cast<int32_t>(response.partition_count)` is
redundant since `response.partition_count` is already defined as `i32`
(int32_t) in the thrift definition. Consider removing the cast or using
`int32_t count = response.partition_count;` directly for clarity.
```suggestion
auto count = response.partition_count;
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]