[Spice-commits] server/red_worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Nov 18 02:14:35 PST 2015
server/red_worker.c | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
New commits:
commit 3fc8d6ab9a81a4080e8e4413243956f37ccb0b4d
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu Nov 12 22:09:30 2015 +0000
worker: simplify red_marshall_image
Remove some nested blocks using else if.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/red_worker.c b/server/red_worker.c
index 73faeee..1af3547 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -6846,27 +6846,23 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI
comp_succeeded = red_jpeg_compress_image(dcc, &red_image,
&bitmap, &comp_send_data,
worker->mem_slots.internal_groupslot_id);
- } else {
- if (quic_comp) {
- comp_succeeded = red_quic_compress_image(dcc, &red_image, &bitmap,
- &comp_send_data,
- worker->mem_slots.internal_groupslot_id);
- } else {
+ } else if (quic_comp) {
+ comp_succeeded = red_quic_compress_image(dcc, &red_image, &bitmap,
+ &comp_send_data,
+ worker->mem_slots.internal_groupslot_id);
#ifdef USE_LZ4
- if (comp_mode == SPICE_IMAGE_COMPRESSION_LZ4 &&
- bitmap_fmt_is_rgb(bitmap.format) &&
- red_channel_client_test_remote_cap(&dcc->common.base,
- SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
- comp_succeeded = red_lz4_compress_image(dcc, &red_image, &bitmap,
- &comp_send_data,
- worker->mem_slots.internal_groupslot_id);
- } else
+ } else if (comp_mode == SPICE_IMAGE_COMPRESSION_LZ4 &&
+ bitmap_fmt_is_rgb(bitmap.format) &&
+ red_channel_client_test_remote_cap(&dcc->common.base,
+ SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
+ comp_succeeded = red_lz4_compress_image(dcc, &red_image, &bitmap,
+ &comp_send_data,
+ worker->mem_slots.internal_groupslot_id);
#endif
- if (comp_mode != SPICE_IMAGE_COMPRESSION_OFF)
- comp_succeeded = red_lz_compress_image(dcc, &red_image, &bitmap,
- &comp_send_data,
- worker->mem_slots.internal_groupslot_id);
- }
+ } else if (comp_mode != SPICE_IMAGE_COMPRESSION_OFF) {
+ comp_succeeded = red_lz_compress_image(dcc, &red_image, &bitmap,
+ &comp_send_data,
+ worker->mem_slots.internal_groupslot_id);
}
surface_lossy_region = &dcc->surface_client_lossy_region[item->surface_id];
More information about the Spice-commits
mailing list