Skip to content

Commit

Permalink
fix: review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Oct 14, 2024
1 parent 78d4d66 commit 494470f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
13 changes: 2 additions & 11 deletions src/link/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,8 @@ size_t _z_link_recv_exact_zbuf(const _z_link_t *link, _z_zbuf_t *zbf, size_t len

z_result_t _z_link_send_wbuf(const _z_link_t *link, const _z_wbuf_t *wbf) {
z_result_t ret = _Z_RES_OK;
bool link_is_streamed;

switch (link->_cap._flow) {
case Z_LINK_CAP_FLOW_STREAM:
link_is_streamed = true;
break;
case Z_LINK_CAP_FLOW_DATAGRAM:
default:
link_is_streamed = false;
break;
}
bool link_is_streamed = link->_cap._flow == Z_LINK_CAP_FLOW_STREAM;

for (size_t i = 0; (i < _z_wbuf_len_iosli(wbf)) && (ret == _Z_RES_OK); i++) {
_z_slice_t bs = _z_iosli_to_bytes(_z_wbuf_get_iosli(wbf, i));
size_t n = bs.len;
Expand Down
12 changes: 2 additions & 10 deletions src/session/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,10 @@
#include "zenoh-pico/utils/logging.h"

/*------------------ clone helpers ------------------*/
_z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp) {
_z_timestamp_t ts;
ts.valid = tstamp->valid;
ts.id = tstamp->id;
ts.time = tstamp->time;
return ts;
}
_z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp) { return *tstamp; }

void _z_timestamp_move(_z_timestamp_t *dst, _z_timestamp_t *src) {
dst->valid = src->valid;
dst->id = src->id;
dst->time = src->time;
*dst = *src;
_z_timestamp_clear(src);
}

Expand Down

0 comments on commit 494470f

Please sign in to comment.