changeset 75885:19bf7ffe644e

(Fcolor_distance): Don't continue checking a color for errors after it has been correctly parsed as an RGB list.
author Juanma Barranquero <lekktu@gmail.com>
date Wed, 14 Feb 2007 15:47:51 +0000
parents ab51c2b6faf8
children 2fca55784362
files src/xfaces.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfaces.c	Wed Feb 14 15:31:09 2007 +0000
+++ b/src/xfaces.c	Wed Feb 14 15:47:51 2007 +0000
@@ -5348,13 +5348,11 @@
   CHECK_LIVE_FRAME (frame);
   f = XFRAME (frame);
 
-  if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1))
-      || !STRINGP (color1)
-      || !defined_color (f, SDATA (color1), &cdef1, 0))
+  if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
+      && !(STRINGP (color1) && defined_color (f, SDATA (color1), &cdef1, 0)))
     signal_error ("Invalid color", color1);
-  if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2))
-      || !STRINGP (color2)
-      || !defined_color (f, SDATA (color2), &cdef2, 0))
+  if (!(CONSP (color2) && parse_rgb_list (color2, &cdef2))
+      && !(STRINGP (color2) && defined_color (f, SDATA (color2), &cdef2, 0)))
     signal_error ("Invalid color", color2);
 
   return make_number (color_distance (&cdef1, &cdef2));