projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e663722
)
Minor optimization to rnibble()
author
Panu Matilainen
<pmatilai@redhat.com>
Mon, 3 Sep 2012 12:44:53 +0000
(15:44 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Mon, 3 Sep 2012 12:44:53 +0000
(15:44 +0300)
- 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
patch
|
blob
|
history
diff --git
a/rpmio/rpmstring.h
b/rpmio/rpmstring.h
index
a1d90d8
..
16ce5ba
100644
(file)
--- 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;
}