[babl] babl: avoid re-creating some existing conversions



commit 10b44495b9af8cc1e159d6269cca9488334deb89
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Nov 16 02:50:15 2018 +0100

    babl: avoid re-creating some existing conversions

 babl/babl-conversion.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c
index 180ddad..a7f7eba 100644
--- a/babl/babl-conversion.c
+++ b/babl/babl-conversion.c
@@ -235,6 +235,11 @@ _conversion_new (const char    *name,
         BABL (babl->conversion.destination),
         babl_type_from_id (BABL_DOUBLE));
 
+      {
+        const Babl *fish = babl_conversion_find (src_format, dst_format);
+        if (fish)
+          return fish;
+      }
       babl_conversion_new (
         src_format,
         dst_format,


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