diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-09-03 15:44:53 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-09-03 15:44:53 +0300 |
commit | 75d88c405b257752a0f7d71054643a954828556f (patch) | |
tree | 7226088a5f426609d5c2ad9a8aa704587440d339 /rpmio | |
parent | e663722a79fbd79f3fb4ce81b2bcf94694952eb4 (diff) | |
download | librpm-tizen-75d88c405b257752a0f7d71054643a954828556f.tar.gz librpm-tizen-75d88c405b257752a0f7d71054643a954828556f.tar.bz2 librpm-tizen-75d88c405b257752a0f7d71054643a954828556f.zip |
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().
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/rpmstring.h | 4 |
1 files 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; } |