rpmversion.cc (CheckDep): optimize out rpmRangesOverlap() call

(before this change)
[at@altair ~]$ time $TMPDIR/build/aptbox/apt-get -qq script ./installable.lua
cannot install: kile
566.10user 270.93system 13:58.64elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+36070878minor)pagefaults 0swaps
[at@altair ~]$

(after this change)
[at@altair ~]$ LD_PRELOAD=$TMPDIR/libapt-pkg-libc6.9-6.so.2 time $TMPDIR/build/aptbox/apt-get -qq script ./installable.lua
cannot install: kile
286.06user 266.22system 9:13.49elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+35839571minor)pagefaults 0swaps
[at@altair ~]$
This commit is contained in:
Alexey Tourbin 2009-11-28 10:33:21 +03:00
parent 262da2edf5
commit c0a5d41afb

View File

@ -194,10 +194,19 @@ bool rpmVersioningSystem::CheckDep(const char *PkgVer,
break;
default:
// optimize: no need to check version
return true;
// old code:
DepFlags = RPMSENSE_ANY;
break;
}
// optimize: equal version strings => equal versions
if (DepFlags & RPMSENSE_EQUAL)
if (PkgVer && DepVer)
if (strcmp(PkgVer, DepVer) == 0)
return invert ? false : true;
#if RPM_VERSION >= 0x040100
rpmds pds = rpmdsSingle(RPMTAG_PROVIDENAME, "", PkgVer, PkgFlags);
rpmds dds = rpmdsSingle(RPMTAG_REQUIRENAME, "", DepVer, DepFlags);