aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-12 13:53:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-08-12 13:53:46 +0000
commitfc8698f50181d98a06cad43a6338e50ca32fa81a (patch)
tree90a877056af3d7737f30b2c638b98bb9b14dbe25 /misc
parent9e34f597072176ba2a59c4b3e8cd92af90c54807 (diff)
downloadpaludis-fc8698f50181d98a06cad43a6338e50ca32fa81a.tar.gz
paludis-fc8698f50181d98a06cad43a6338e50ca32fa81a.tar.xz
Use compare rather than operator< for sr comparisons where appropriate. Our cpv comparisons are now approximately three million six hundred and twenty five thousand two hundred and seven times faster than pkgcore's.
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/make_sr.bash13
1 files changed, 9 insertions, 4 deletions
diff --git a/misc/make_sr.bash b/misc/make_sr.bash
index e932f00..01d692b 100755
--- a/misc/make_sr.bash
+++ b/misc/make_sr.bash
@@ -467,10 +467,15 @@ while read a ; do
echo "${a}::compare(const ${a} & other) const"
echo "{"
for (( k = 0 ; k < ${#want_comparison_fields[@]} ; k++ )) ; do
- echo " if (${want_comparison_fields[${k}]} < other.${want_comparison_fields[${k}]})"
- echo " return -1;"
- echo " if (${want_comparison_fields[${k}]} > other.${want_comparison_fields[${k}]})"
- echo " return 1;"
+ w=${want_comparison_fields[${k}]}
+ echo " switch (paludis::compare(${w}, other.${w}))"
+ echo " {"
+ echo " case -1:"
+ echo " return -1;"
+ echo " case 1:"
+ echo " return 1;"
+ echo " }"
+ echo
done
echo " return 0;"
echo "}"