summaryrefslogtreecommitdiff
path: root/lib/query.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-04-07 19:52:42 +0000
committerjbj <devnull@localhost>2002-04-07 19:52:42 +0000
commitffdfd1056e25d18f95776fbff43fceca864be95f (patch)
tree56e72d723560122b38d8a2eb3a00e147ae0440e0 /lib/query.c
parent6e2d56377d4ac91f44918e58918d777540f6565c (diff)
downloadlibrpm-tizen-ffdfd1056e25d18f95776fbff43fceca864be95f.tar.gz
librpm-tizen-ffdfd1056e25d18f95776fbff43fceca864be95f.tar.bz2
librpm-tizen-ffdfd1056e25d18f95776fbff43fceca864be95f.zip
- speedup large queries by ~50%.
- revert to presentation ordering Yet Again (#62158). - non-glibc: on upgrade, mergesort is much faster than quicksort. CVS patchset: 5377 CVS date: 2002/04/07 19:52:42
Diffstat (limited to 'lib/query.c')
-rw-r--r--lib/query.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/query.c b/lib/query.c
index 58e5445e2..dd642635c 100644
--- a/lib/query.c
+++ b/lib/query.c
@@ -778,7 +778,7 @@ restart:
for (i = 0, t = md5, s = arg; i < 16; i++, t++, s += 2)
*t = (nibble(s[0]) << 4) | nibble(s[1]);
- qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SIGMD5, md5, 16);
+ qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_SIGMD5, md5, sizeof(md5));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"pkgid", arg);
@@ -807,6 +807,9 @@ restart:
break;
case RPMQV_FILEID:
+ { unsigned char md5[16];
+ unsigned char * t;
+
for (i = 0, s = arg; *s && isxdigit(*s); s++, i++)
{};
if (i != 32) {
@@ -814,7 +817,11 @@ restart:
return 1;
}
- qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, arg, 0);
+ md5[0] = '\0';
+ for (i = 0, t = md5, s = arg; i < 16; i++, t++, s += 2)
+ *t = (nibble(s[0]) << 4) | nibble(s[1]);
+
+ qva->qva_mi = rpmtsInitIterator(ts, RPMTAG_FILEMD5S, md5, sizeof(md5));
if (qva->qva_mi == NULL) {
rpmError(RPMERR_QUERYINFO, _("no package matches %s: %s\n"),
"fileid", arg);
@@ -822,7 +829,7 @@ restart:
} else {
res = showMatches(qva, ts);
}
- break;
+ } break;
case RPMQV_TID:
{ int mybase = 10;