From 6e008f9acc8126bac3746c80fbb1c7ef7b93bc07 Mon Sep 17 00:00:00 2001 From: sam Date: Wed, 5 Jan 2005 22:55:05 +0000 Subject: [PATCH] * better efficiency git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/pwntcha/trunk@428 92316355-f0b4-4df1-b90c-862c8a59935f --- src/phpbb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/phpbb.c b/src/phpbb.c index 0c05954..9ad829b 100644 --- a/src/phpbb.c +++ b/src/phpbb.c @@ -88,7 +88,10 @@ char *decode_phpbb(struct image *img) int r2; getgray(font, xmin + z, ymin + t, &r); getgray(tmp2, x + z, y + t, &r2); - dist += (r - r2) * (r - r2); + if(r > r2) + dist += r - r2; + else + dist += (r2 - r) * 3 / 4; } if(dist < localmin) {