mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-30 09:46:50 +00:00
clang-tidy: remove pointless move
Found with performance-move-const-arg Allows better optimization as the compiler does not have to deal with an rvalue reference. Especially in C++17 where std::move can prevent copy elision. Signed-off-by: Rosen Penev <rosenp@gmail.com> Acked-by: Frediano Ziglio <freddy77@gmail.com>
This commit is contained in:
parent
8af176b15e
commit
5f8d49efaa
@ -223,7 +223,7 @@ void CursorChannel::process_cmd(RedCursorCmd *cursor_cmd)
|
||||
(mouse_mode == SPICE_MOUSE_MODE_SERVER
|
||||
|| cursor_cmd->type != QXL_CURSOR_MOVE
|
||||
|| cursor_show)) {
|
||||
pipes_add(std::move(cursor_pipe_item));
|
||||
pipes_add(cursor_pipe_item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ void dcc_create_surface(DisplayChannelClient *dcc, int surface_id)
|
||||
surface->context.height,
|
||||
surface->context.format, flags);
|
||||
dcc->priv->surface_client_created[surface_id] = TRUE;
|
||||
dcc->pipe_add(std::move(create));
|
||||
dcc->pipe_add(create);
|
||||
}
|
||||
|
||||
// adding the pipe item after pos. If pos == NULL, adding to head.
|
||||
@ -238,9 +238,9 @@ dcc_add_surface_area_image(DisplayChannelClient *dcc, int surface_id,
|
||||
}
|
||||
|
||||
if (pipe_item_pos != dcc->get_pipe().end()) {
|
||||
dcc->pipe_add_after_pos(std::move(item), pipe_item_pos);
|
||||
dcc->pipe_add_after_pos(item, pipe_item_pos);
|
||||
} else {
|
||||
dcc->pipe_add(std::move(item));
|
||||
dcc->pipe_add(item);
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ void dcc_prepend_drawable(DisplayChannelClient *dcc, Drawable *drawable)
|
||||
auto dpi = red::make_shared<RedDrawablePipeItem>(dcc, drawable);
|
||||
|
||||
add_drawable_surface_images(dcc, drawable);
|
||||
dcc->pipe_add(std::move(dpi));
|
||||
dcc->pipe_add(dpi);
|
||||
}
|
||||
|
||||
void dcc_append_drawable(DisplayChannelClient *dcc, Drawable *drawable)
|
||||
@ -323,7 +323,7 @@ void dcc_append_drawable(DisplayChannelClient *dcc, Drawable *drawable)
|
||||
auto dpi = red::make_shared<RedDrawablePipeItem>(dcc, drawable);
|
||||
|
||||
add_drawable_surface_images(dcc, drawable);
|
||||
dcc->pipe_add_tail(std::move(dpi));
|
||||
dcc->pipe_add_tail(dpi);
|
||||
}
|
||||
|
||||
void dcc_add_drawable_after(DisplayChannelClient *dcc, Drawable *drawable, RedPipeItem *pos)
|
||||
@ -331,7 +331,7 @@ void dcc_add_drawable_after(DisplayChannelClient *dcc, Drawable *drawable, RedPi
|
||||
auto dpi = red::make_shared<RedDrawablePipeItem>(dcc, drawable);
|
||||
|
||||
add_drawable_surface_images(dcc, drawable);
|
||||
dcc->pipe_add_after(std::move(dpi), pos);
|
||||
dcc->pipe_add_after(dpi, pos);
|
||||
}
|
||||
|
||||
static void dcc_init_stream_agents(DisplayChannelClient *dcc)
|
||||
@ -475,7 +475,7 @@ void dcc_video_stream_agent_clip(DisplayChannelClient* dcc, VideoStreamAgent *ag
|
||||
{
|
||||
auto item = red::make_shared<VideoStreamClipItem>(agent);
|
||||
|
||||
dcc->pipe_add(std::move(item));
|
||||
dcc->pipe_add(item);
|
||||
}
|
||||
|
||||
RedMonitorsConfigItem::~RedMonitorsConfigItem()
|
||||
@ -503,7 +503,7 @@ void dcc_push_monitors_config(DisplayChannelClient *dcc)
|
||||
}
|
||||
|
||||
auto mci = red::make_shared<RedMonitorsConfigItem>(monitors_config);
|
||||
dcc->pipe_add(std::move(mci));
|
||||
dcc->pipe_add(mci);
|
||||
}
|
||||
|
||||
RedSurfaceDestroyItem::RedSurfaceDestroyItem(uint32_t surface_id)
|
||||
@ -564,7 +564,7 @@ void dcc_destroy_surface(DisplayChannelClient *dcc, uint32_t surface_id)
|
||||
|
||||
dcc->priv->surface_client_created[surface_id] = FALSE;
|
||||
auto destroy = red::make_shared<RedSurfaceDestroyItem>(surface_id);
|
||||
dcc->pipe_add(std::move(destroy));
|
||||
dcc->pipe_add(destroy);
|
||||
}
|
||||
|
||||
#define MIN_DIMENSION_TO_QUIC 3
|
||||
|
||||
@ -203,7 +203,7 @@ void MainChannelClient::push_agent_tokens(uint32_t num_tokens)
|
||||
|
||||
void MainChannelClient::push_agent_data(red::shared_ptr<RedAgentDataPipeItem>&& item)
|
||||
{
|
||||
pipe_add_push(std::move(item));
|
||||
pipe_add_push(item);
|
||||
}
|
||||
|
||||
static RedPipeItemPtr
|
||||
|
||||
@ -1251,7 +1251,7 @@ void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient *mcc)
|
||||
switch (vdi_port_read_buf_process(agent_dev, *read_buf)) {
|
||||
case AGENT_MSG_FILTER_OK:
|
||||
reds_adjust_agent_capabilities(reds, (VDAgentMessage *)read_buf->data);
|
||||
mcc->push_agent_data(std::move(read_buf));
|
||||
mcc->push_agent_data(read_buf);
|
||||
break;
|
||||
case AGENT_MSG_FILTER_PROTO_ERROR:
|
||||
reds_agent_remove(reds);
|
||||
|
||||
@ -270,7 +270,7 @@ static void spicevmc_port_send_init(VmcChannelClient *rcc)
|
||||
SpiceCharDeviceInstance *sin = channel->chardev_sin;
|
||||
auto item = red::make_shared<RedPortInitPipeItem>(sin->portname, channel->port_opened);
|
||||
|
||||
rcc->pipe_add_push(std::move(item));
|
||||
rcc->pipe_add_push(item);
|
||||
}
|
||||
|
||||
static void spicevmc_port_send_event(RedChannelClient *rcc, uint8_t event)
|
||||
@ -278,7 +278,7 @@ static void spicevmc_port_send_event(RedChannelClient *rcc, uint8_t event)
|
||||
auto item = red::make_shared<RedPortEventPipeItem>();
|
||||
|
||||
item->event = event;
|
||||
rcc->pipe_add_push(std::move(item));
|
||||
rcc->pipe_add_push(item);
|
||||
}
|
||||
|
||||
void RedCharDeviceSpiceVmc::remove_client(RedCharDeviceClientOpaque *opaque)
|
||||
@ -473,7 +473,7 @@ static void
|
||||
spicevmc_red_channel_queue_data(RedVmcChannel *channel, red::shared_ptr<RedVmcPipeItem>&& item)
|
||||
{
|
||||
channel->queued_data += item->buf_used;
|
||||
channel->rcc->pipe_add_push(std::move(item));
|
||||
channel->rcc->pipe_add_push(item);
|
||||
}
|
||||
|
||||
static void spicevmc_red_channel_send_data(VmcChannelClient *rcc,
|
||||
|
||||
@ -434,7 +434,7 @@ StreamChannel::change_format(const StreamMsgFormat *fmt)
|
||||
item->stream_create.src_height = fmt->height;
|
||||
item->stream_create.dest = (SpiceRect) { 0, 0, fmt->width, fmt->height };
|
||||
item->stream_create.clip = (SpiceClip) { SPICE_CLIP_TYPE_NONE, nullptr };
|
||||
pipes_add(std::move(item));
|
||||
pipes_add(item);
|
||||
|
||||
// activate stream report if possible
|
||||
pipes_add_type(RED_PIPE_ITEM_TYPE_STREAM_ACTIVATE_REPORT);
|
||||
|
||||
@ -845,7 +845,7 @@ static void dcc_detach_stream_gracefully(DisplayChannelClient *dcc,
|
||||
upgrade_item->rects->num_rects = n_rects;
|
||||
region_ret_rects(&upgrade_item->drawable->tree_item.base.rgn,
|
||||
upgrade_item->rects->rects, n_rects);
|
||||
dcc->pipe_add(std::move(upgrade_item));
|
||||
dcc->pipe_add(upgrade_item);
|
||||
|
||||
} else {
|
||||
SpiceRect upgrade_area;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user