ref: 8a9976018f1a147abc3441d98e428592f5c82cfc
parent: b934e2acad9936555e02465fd75f208bceb4d1c5
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Oct 11 15:56:11 EDT 2023
edge: use memset instead of for loop
--- a/r_edge.c
+++ b/r_edge.c
@@ -102,7 +102,7 @@
*/
void R_BeginEdgeFrame (void)
{
- int v;
+ int v, n;
Arr_AllocExtra(&r_edges, &r_numallocatededges, r_outofedges);
edge_p = r_edges;
@@ -132,11 +132,10 @@
r_currentkey = 0;
}
-// FIXME: set with memset
- for (v=r_refdef.vrect.y ; v<r_refdef.vrectbottom ; v++)
- {
- newedges[v] = removeedges[v] = nil;
- }
+ v = r_refdef.vrect.y;
+ n = r_refdef.vrectbottom - v;
+ memset(newedges+v, 0, n*sizeof(*newedges));
+ memset(removeedges+v, 0, n*sizeof(*removeedges));
}