From be7a2b77911991fa799c44ff9420fb3249efccb0 Mon Sep 17 00:00:00 2001 From: Allanis Date: Tue, 26 Feb 2013 23:50:00 +0000 Subject: [PATCH] [Change] Simplifies spfx_destroy, performs a little better.. --- src/spfx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spfx.c b/src/spfx.c index e8872cc..e96d267 100644 --- a/src/spfx.c +++ b/src/spfx.c @@ -142,10 +142,8 @@ void spfx_clear(void) { } static void spfx_destroy(SPFX* layer, int* nlayer, int spfx) { - int i; (*nlayer)--; - for(i = spfx; i < *nlayer; i++) - memcpy(&layer[i], &layer[i+1], sizeof(SPFX)); + memmove(&layer[spfx], &layer[spfx+1], (*nlayer-spfx)*sizeof(SPFX)); } void spfx_update(const double dt) {