From 42f02103e5fb7e86a1b90de174d25772ff655a2d Mon Sep 17 00:00:00 2001
From: Per Hedbor <ph@opera.com>
Date: Sat, 10 Apr 1999 01:21:09 +0200
Subject: [PATCH] Optimizations

Rev: lib/modules/_Image_XPM.pmod:1.6
---
 lib/modules/_Image_XPM.pmod | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/modules/_Image_XPM.pmod b/lib/modules/_Image_XPM.pmod
index 82905f4f13..be9d62698c 100644
--- a/lib/modules/_Image_XPM.pmod
+++ b/lib/modules/_Image_XPM.pmod
@@ -64,11 +64,13 @@ mapping _decode( string what, void|mapping opts )
     retopts->hot_y = values[5];
   }
   TD("Colors");
-  mixed colors = ([]);
   if(sizeof(data) < ncolors+2)
     error("Too few elements in array to decode color values\n");
-
-  colors = sort(data[1..ncolors]);
+  array colors;
+  if(cpp < 4)
+    colors = data[1..ncolors];
+  else
+    colors = sort(data[1..ncolors]);
   TD("Creating images");
   object i = Image.image( width, height );
   object a = Image.image( width, height,255,255,255 );
-- 
GitLab