mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcursor.git
synced 2025-12-26 05:20:07 +01:00
Remove unnecessary MIN calls
This commit is contained in:
parent
a21cdaf167
commit
dfc8561247
1 changed files with 2 additions and 3 deletions
|
|
@ -23,7 +23,6 @@
|
||||||
#include "xcursorint.h"
|
#include "xcursorint.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/param.h>
|
|
||||||
|
|
||||||
XcursorImage *
|
XcursorImage *
|
||||||
XcursorImageCreate (int width, int height)
|
XcursorImageCreate (int width, int height)
|
||||||
|
|
@ -640,12 +639,12 @@ _XcursorResizeImage (XcursorImage *src, int size)
|
||||||
|
|
||||||
for (int dest_y = 0; dest_y < dest->height; dest_y++)
|
for (int dest_y = 0; dest_y < dest->height; dest_y++)
|
||||||
{
|
{
|
||||||
int src_y = MIN((int) (dest_y / scale), src->height - 1);
|
int src_y = dest_y / scale;
|
||||||
XcursorPixel *src_row = src->pixels + src_y * src->width;
|
XcursorPixel *src_row = src->pixels + src_y * src->width;
|
||||||
XcursorPixel *dest_row = dest->pixels + dest_y * dest->width;
|
XcursorPixel *dest_row = dest->pixels + dest_y * dest->width;
|
||||||
for (int dest_x = 0; dest_x < dest->width; dest_x++)
|
for (int dest_x = 0; dest_x < dest->width; dest_x++)
|
||||||
{
|
{
|
||||||
int src_x = MIN((int) (dest_x / scale), src->width - 1);
|
int src_x = dest_x / scale;
|
||||||
dest_row[dest_x] = src_row[src_x];
|
dest_row[dest_x] = src_row[src_x];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue