mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 13:20:28 +00:00
Simplify Image_set_bytes(): as bytes_size == bytes_needed we don't need to call std::min()
This commit is contained in:
parent
b6d7c1e261
commit
c117b1b01f
@ -498,7 +498,7 @@ int Image_set_bytes(lua_State* L)
|
||||
const char* bytes = lua_tolstring(L, 2, &bytes_size);
|
||||
|
||||
if (bytes_size == bytes_needed) {
|
||||
std::memcpy(img->getPixelAddress(0, 0), bytes, std::min(bytes_needed, bytes_size));
|
||||
std::memcpy(img->getPixelAddress(0, 0), bytes, bytes_size);
|
||||
}
|
||||
else {
|
||||
lua_pushfstring(L, "Data size does not match: given %d, needed %d.", bytes_size, bytes_needed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user