[gimp] plug-ins: fix missing "plug-in-colormap-swap" procedure.



commit 0fc8821932f21dd924204f4d17ec24efa2dde914
Author: Jehan <jehan girinstud io>
Date:   Sat Sep 19 19:27:26 2020 +0200

    plug-ins: fix missing "plug-in-colormap-swap" procedure.
    
    Existing code was returning only 1 out of 2 expected procedure names.
    
    See !241 for the originally proposed patch by Rafał Mikrut (@qarmin).
    Unfortunately the proposed patch also had another bug and was always
    returning an empty list instead, and the contributor is unresponsive. So
    let's just redo the patch and be done with it.
    
    Also using g_list_prepend() instead of g_list_append() as it's usually
    more efficient (to be fair here, for a size-2 list, it doesn't matter
    much but it's good practice anyway) and order doesn't matter.
    
    Thanks Rafał Mikrut for noticing the original bug!

 plug-ins/common/colormap-remap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/colormap-remap.c b/plug-ins/common/colormap-remap.c
index 2859cb06ca..cfd85fa21d 100644
--- a/plug-ins/common/colormap-remap.c
+++ b/plug-ins/common/colormap-remap.c
@@ -105,8 +105,8 @@ remap_query_procedures (GimpPlugIn *plug_in)
 {
   GList *list = NULL;
 
-  return g_list_append (list, g_strdup (PLUG_IN_PROC_REMAP));
-  return g_list_append (list, g_strdup (PLUG_IN_PROC_SWAP));
+  list = g_list_prepend (list, g_strdup (PLUG_IN_PROC_REMAP));
+  list = g_list_prepend (list, g_strdup (PLUG_IN_PROC_SWAP));
 
   return list;
 }


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