From 126d1639c94fe97e2fc3f849279640ad78bc379d Mon Sep 17 00:00:00 2001 From: Ray Johnston Date: Thu, 17 Jul 2014 09:41:03 -0700 Subject: Minor optimization in test_device. Don't convert and compare color if we already know the page has color. --- source/fitz/test-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/fitz/test-device.c') diff --git a/source/fitz/test-device.c b/source/fitz/test-device.c index e128e053..fd1fcd73 100644 --- a/source/fitz/test-device.c +++ b/source/fitz/test-device.c @@ -10,7 +10,7 @@ fz_test_colorspace(fz_context *ctx, fz_colorspace *colorspace, int *iscolor) static void fz_test_color(fz_context *ctx, fz_colorspace *colorspace, float *color, int *iscolor) { - if (colorspace && colorspace != fz_device_gray(ctx)) + if (*iscolor != 0 && colorspace && colorspace != fz_device_gray(ctx)) { float rgb[3]; fz_convert_color(ctx, fz_device_rgb(ctx), rgb, colorspace, color); -- cgit v1.2.3