Skip to content

Commit

Permalink
直接return
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Ojii committed May 27, 2024
1 parent cffa790 commit 90af786
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dll_src/ImageLoader_M.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ std::optional<ImageData> get_image_data_gdiplus(std::string_view filename) {
memcpy(mapped_pixels.pixels, reinterpret_cast<byte*>(bmpData.Scan0), bytes);
image->UnlockBits(&bmpData);

std::optional<ImageData> dt(std::move(data));

return dt;
return std::optional<ImageData>(std::move(data));
}

std::optional<ImageData> get_image_data_susie(std::string_view filename) {
Expand Down Expand Up @@ -245,9 +243,7 @@ std::optional<ImageData> get_image_data_susie(std::string_view filename) {
memcpy(mapped_pixels.pixels + (data.width * i), reinterpret_cast<void*>((reinterpret_cast<byte*>(lp.pBm) + data.get_bytes() - data.width * 4 * (i + 1))), data.width * 4);
}

std::optional<ImageData> dt(std::move(data));

return dt;
return std::optional<ImageData>(std::move(data));
}
}

Expand Down

0 comments on commit 90af786

Please sign in to comment.