[Spice-commits] server/cursor-channel.cpp server/dcc.cpp server/main-channel-client.cpp server/reds.cpp server/spicevmc.cpp server/stream-channel.cpp server/video-stream.cpp
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 14 12:08:04 UTC 2021
server/cursor-channel.cpp | 2 +-
server/dcc.cpp | 18 +++++++++---------
server/main-channel-client.cpp | 2 +-
server/reds.cpp | 2 +-
server/spicevmc.cpp | 6 +++---
server/stream-channel.cpp | 2 +-
server/video-stream.cpp | 2 +-
7 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit 5f8d49efaa7458840dcf964cacd4701b0ed7959e
Author: Rosen Penev <rosenp at gmail.com>
Date: Mon Oct 5 02:51:30 2020 -0700
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 at gmail.com>
Acked-by: Frediano Ziglio <freddy77 at gmail.com>
diff --git a/server/cursor-channel.cpp b/server/cursor-channel.cpp
index 284f6914..8bb06134 100644
--- a/server/cursor-channel.cpp
+++ b/server/cursor-channel.cpp
@@ -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);
}
}
diff --git a/server/dcc.cpp b/server/dcc.cpp
index faf04213..30afae59 100644
--- a/server/dcc.cpp
+++ b/server/dcc.cpp
@@ -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
diff --git a/server/main-channel-client.cpp b/server/main-channel-client.cpp
index 73e0d56e..4c6b845b 100644
--- a/server/main-channel-client.cpp
+++ b/server/main-channel-client.cpp
@@ -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
diff --git a/server/reds.cpp b/server/reds.cpp
index 73cc7390..fa6e393a 100644
--- a/server/reds.cpp
+++ b/server/reds.cpp
@@ -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);
diff --git a/server/spicevmc.cpp b/server/spicevmc.cpp
index dd73a352..55e217de 100644
--- a/server/spicevmc.cpp
+++ b/server/spicevmc.cpp
@@ -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,
diff --git a/server/stream-channel.cpp b/server/stream-channel.cpp
index bced4fd8..c3e09ca0 100644
--- a/server/stream-channel.cpp
+++ b/server/stream-channel.cpp
@@ -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);
diff --git a/server/video-stream.cpp b/server/video-stream.cpp
index 7c731f35..fadeda8f 100644
--- a/server/video-stream.cpp
+++ b/server/video-stream.cpp
@@ -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;
More information about the Spice-commits
mailing list