remove unnecessary alloca
This commit is contained in:
parent
d72a583163
commit
9c886b5d3e
|
@ -201,6 +201,7 @@
|
|||
rect.origin = NSMakePoint(j * (fWidth + BETWEEN) + BETWEEN + fExtraBorder,
|
||||
[image size].width - (i + 1) * (fWidth + BETWEEN) - fExtraBorder);
|
||||
|
||||
#warning use NSRectFillListWithColors
|
||||
[pieceColor set];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
|
|
|
@ -682,7 +682,7 @@
|
|||
|
||||
const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
|
||||
|
||||
NSRect * gridRects = (NSRect *)alloca(sizeof(NSRect) * (ceil(visibleRect.size.height / totalRowHeight) / 2));
|
||||
NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight) / 2)];
|
||||
NSInteger rectNum = 0;
|
||||
|
||||
if (rows.length > 0)
|
||||
|
@ -729,6 +729,7 @@
|
|||
visibleRect.size.height = totalRowHeight;
|
||||
if (start)
|
||||
visibleRect.origin.y += totalRowHeight;
|
||||
|
||||
for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
|
||||
{
|
||||
gridRects[rectNum++] = visibleRect;
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
|
||||
|
||||
NSRect * gridRects = (NSRect *)alloca(sizeof(NSRect) * (ceil(visibleRect.size.height / totalRowHeight) / 2));
|
||||
NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight) / 2)];
|
||||
NSInteger rectNum = 0;
|
||||
|
||||
if (rows.length > 0)
|
||||
|
@ -93,6 +93,7 @@
|
|||
visibleRect.size.height = totalRowHeight;
|
||||
if (start)
|
||||
visibleRect.origin.y += totalRowHeight;
|
||||
|
||||
for (NSInteger i = start ? 1 : 0; i < numberBlankRows; i += 2)
|
||||
{
|
||||
gridRects[rectNum++] = visibleRect;
|
||||
|
|
Loading…
Reference in New Issue