Skip to content

Commit 6877a48

Browse files
committed
Added feedback
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
1 parent 8cd19bf commit 6877a48

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

rmw_zenoh_cpp/src/detail/rmw_client_data.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,12 @@ void ClientData::add_new_reply(std::unique_ptr<ZenohReply> reply)
233233
reply_queue_.size() >= adapted_qos_profile.depth)
234234
{
235235
// Log warning if message is discarded due to hitting the queue depth
236-
std::string keystr = std::string(keyexpr_.value().as_string_view());
237236
RMW_ZENOH_LOG_ERROR_NAMED(
238237
"rmw_zenoh_cpp",
239238
"Query queue depth of %ld reached, discarding oldest Query "
240-
"for client for %.*s",
239+
"for client for %s",
241240
adapted_qos_profile.depth,
242-
keystr.size(),
243-
keystr.c_str());
241+
keyexpr_.value().as_string_view());
244242
reply_queue_.pop_front();
245243
}
246244
reply_queue_.emplace_back(std::move(reply));
@@ -407,10 +405,11 @@ rmw_ret_t ClientData::send_request(
407405
parameters,
408406
[client_data](const zenoh::Reply & reply) {
409407
if (!reply.is_ok()) {
408+
auto reply_err_str = reply.get_err().get_payload().as_string();
410409
RMW_ZENOH_LOG_ERROR_NAMED(
411410
"rmw_zenoh_cpp",
412411
"z_reply_is_ok returned False Reason: %s",
413-
reply.get_err().get_payload().as_string())
412+
reply_err_str.c_str())
414413
return;
415414
}
416415
const zenoh::Sample & sample = reply.get_ok();
@@ -420,7 +419,7 @@ rmw_ret_t ClientData::send_request(
420419
RMW_ZENOH_LOG_ERROR_NAMED(
421420
"rmw_zenoh_cpp",
422421
"Unable to obtain ClientData from data for %s.",
423-
std::string(sample.get_keyexpr().as_string_view()));
422+
sample.get_keyexpr().as_string_view());
424423
return;
425424
}
426425

rmw_zenoh_cpp/src/detail/rmw_service_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
156156
RMW_ZENOH_LOG_ERROR_NAMED(
157157
"rmw_zenoh_cpp",
158158
"Unable to obtain ServiceData from data for %s.",
159-
std::string(query.get_keyexpr().as_string_view()));
159+
query.get_keyexpr().as_string_view());
160160
return;
161161
}
162162

rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool SubscriptionData::init()
212212
RMW_ZENOH_LOG_ERROR_NAMED(
213213
"rmw_zenoh_cpp",
214214
"Unable to obtain SubscriptionData from data for %s.",
215-
std::string(sample.get_keyexpr().as_string_view()));
215+
sample.get_keyexpr().as_string_view());
216216
return;
217217
}
218218

rmw_zenoh_cpp/src/detail/zenoh_utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ zenoh::Bytes create_map_and_set_sequence_num(
4949
int64_t source_timestamp = now_ns.count();
5050

5151
rmw_zenoh_cpp::AttachmentData data(sequence_number, source_timestamp, gid);
52-
return std::move(data.serialize_to_zbytes());
52+
return data.serialize_to_zbytes();
5353
}
5454

5555
///=============================================================================

0 commit comments

Comments
 (0)