Streamline alpm_splitdep() comparisons
commit499e09734bc6f4a121b3363d88aeb085bcfd9ce9
authorDan McGee <dan@archlinux.org>
Mon, 29 Aug 2011 04:29:53 +0000 (28 23:29 -0500)
committerDan McGee <dan@archlinux.org>
Tue, 30 Aug 2011 00:54:18 +0000 (29 19:54 -0500)
tree029709f8e021f17a6f9c57100af92e45b91ff87f
parentb3c0ae5205ee9615af077ff00b1a01be3aab4eb6
Streamline alpm_splitdep() comparisons

This reduces from 5 to 3 the number of searches needed on the string
looking for a comparison operator, since we can so a second quick
comparison looking for '=' if we find '<' or '>'. It also makes every
search doable with strchr() or memchr() rather than the slower strstr()
method.

In testing, only 10% of splitdep calls (~1600 / 16000) during an -Ss
database load found a version comparison operator, so optimizing the not
found path to be require less work makes sense.

Signed-off-by: Dan McGee <dan@archlinux.org>
lib/libalpm/deps.c