[gegl] operations/common/grey: Use memcpy instead of a loop



commit bc1429126065ceb84a7a7ee98d521971ec87cb43
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Feb 4 08:41:04 2015 +0100

    operations/common/grey: Use memcpy instead of a loop
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743962

 operations/common/grey.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/operations/common/grey.c b/operations/common/grey.c
index eb1e7d2..6643761 100644
--- a/operations/common/grey.c
+++ b/operations/common/grey.c
@@ -30,6 +30,7 @@
 #define GEGL_OP_C_SOURCE grey.c
 
 #include "gegl-op.h"
+#include <string.h>
 
 static void prepare (GeglOperation *operation)
 {
@@ -49,14 +50,7 @@ process (GeglOperation       *op,
          const GeglRectangle *roi,
          gint                 level)
 {
-  float *in = in_buf;
-  float *out = out_buf;
-  while (samples--)
-    {
-      *out++ = *in++;
-      *out++ = *in++;
-    }
-
+  memcpy (out_buf, in_buf, sizeof (gfloat) * 2 * samples);
   return TRUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]