From c5ee7fd0086d0542cfee23df4a8d4e8e43a34617 Mon Sep 17 00:00:00 2001 From: loki Date: Sun, 12 Jan 2020 01:00:43 +0100 Subject: [PATCH] Removed unnecessary if statement --- sunshine/platform/linux.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sunshine/platform/linux.cpp b/sunshine/platform/linux.cpp index 6c020751..699921c2 100644 --- a/sunshine/platform/linux.cpp +++ b/sunshine/platform/linux.cpp @@ -227,15 +227,13 @@ struct shm_attr_t : public x11_attr_t { } if(img->width != display->width_in_pixels || img->height != display->height_in_pixels) { - if(img->data) { - delete[] img->data; - } + delete[] img->data; img->data = new std::uint8_t[frame_size()]; img->width = display->width_in_pixels; img->height = display->height_in_pixels; } - + std::copy_n((std::uint8_t*)data.data, frame_size(), img->data); if(cursor) {