diff options
author | 2006-08-12 13:53:46 +0000 | |
---|---|---|
committer | 2006-08-12 13:53:46 +0000 | |
commit | fc8698f50181d98a06cad43a6338e50ca32fa81a (patch) | |
tree | 90a877056af3d7737f30b2c638b98bb9b14dbe25 /misc | |
parent | 9e34f597072176ba2a59c4b3e8cd92af90c54807 (diff) | |
download | paludis-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-x | misc/make_sr.bash | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/misc/make_sr.bash b/misc/make_sr.bash index e932f0086..01d692b06 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 "}" |