From 75d88c405b257752a0f7d71054643a954828556f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 3 Sep 2012 15:44:53 +0300 Subject: [PATCH] Minor optimization to rnibble() - Check for lowercase letters before uppercase. A very minor difference as such, but our file digests use lowercase hex and this gets called a lot from rpmfiNew(). --- rpmio/rpmstring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpmio/rpmstring.h b/rpmio/rpmstring.h index a1d90d8ee..16ce5ba66 100644 --- a/rpmio/rpmstring.h +++ b/rpmio/rpmstring.h @@ -97,10 +97,10 @@ static inline unsigned char rnibble(char c) { if (c >= '0' && c <= '9') return (c - '0'); - if (c >= 'A' && c <= 'F') - return (c - 'A') + 10; if (c >= 'a' && c <= 'f') return (c - 'a') + 10; + if (c >= 'A' && c <= 'F') + return (c - 'A') + 10; return 0; }