summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2005-11-10 16:47:00 -0600
committerSteve Peters <steve@fisharerojo.org>2005-11-11 04:55:56 +0000
commit0bcc34c2b0b0cb62c0df3d5e562b779fb96595ba (patch)
treebe9a7c05ed82c609d0018f1f3ac8395cdefc28a7 /pp_sort.c
parent50c1ac04356af5f8e8f967db7ed083187aacb550 (diff)
downloadperl-0bcc34c2b0b0cb62c0df3d5e562b779fb96595ba.tar.gz
Const & local: Special Victims Unit
Message-ID: <20051111044700.GA24161@petdance.com> p4raw-id: //depot/perl@26082
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pp_sort.c b/pp_sort.c
index 245426e891..7580bf3b40 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1322,24 +1322,24 @@ S_qsortsvu(pTHX_ SV ** array, size_t num_elts, SVCOMPARE_t compare)
static I32
cmpindir(pTHX_ gptr a, gptr b)
{
- I32 sense;
gptr * const ap = (gptr *)a;
gptr * const bp = (gptr *)b;
+ const I32 sense = PL_sort_RealCmp(aTHX_ *ap, *bp);
- if ((sense = PL_sort_RealCmp(aTHX_ *ap, *bp)) == 0)
- sense = (ap > bp) ? 1 : ((ap < bp) ? -1 : 0);
- return sense;
+ if (sense)
+ return sense;
+ return (ap > bp) ? 1 : ((ap < bp) ? -1 : 0);
}
static I32
cmpindir_desc(pTHX_ gptr a, gptr b)
{
- I32 sense;
gptr * const ap = (gptr *)a;
gptr * const bp = (gptr *)b;
+ const I32 sense = PL_sort_RealCmp(aTHX_ *ap, *bp);
/* Reverse the default */
- if ((sense = PL_sort_RealCmp(aTHX_ *ap, *bp)))
+ if (sense)
return -sense;
/* But don't reverse the stability test. */
return (ap > bp) ? 1 : ((ap < bp) ? -1 : 0);
@@ -1491,7 +1491,7 @@ PP(pp_sort)
GV *gv;
CV *cv = 0;
I32 gimme = GIMME;
- OP* nextop = PL_op->op_next;
+ OP* const nextop = PL_op->op_next;
I32 overloading = 0;
bool hasargs = FALSE;
I32 is_xsub = 0;
@@ -1660,7 +1660,7 @@ PP(pp_sort)
cx->blk_gimme = G_SCALAR;
PUSHSUB(cx);
if (!is_xsub) {
- AV* padlist = CvPADLIST(cv);
+ AV* const padlist = CvPADLIST(cv);
if (++CvDEPTH(cv) >= 2) {
PERL_STACK_OVERFLOW_CHECK();
@@ -1714,7 +1714,7 @@ PP(pp_sort)
if (priv & OPpSORT_REVERSE) {
SV **q = start+max-1;
while (start < q) {
- SV *tmp = *start;
+ SV * const tmp = *start;
*start++ = *q;
*q-- = tmp;
}