From a72e4eeb62545fd6c474e03d2d613d2a273cd57c Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 8 Jul 2012 21:51:37 +0000 Subject: fix comments git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1713 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- converter/ppm/ppmtospu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'converter/ppm') diff --git a/converter/ppm/ppmtospu.c b/converter/ppm/ppmtospu.c index c655ca05..5bbbc2d3 100644 --- a/converter/ppm/ppmtospu.c +++ b/converter/ppm/ppmtospu.c @@ -245,9 +245,10 @@ sort(struct PixelType * const pixelType, int i, j; /* Rearrange so that everything less than 'pivot' is on the left side of - the subject array slice, while everything else is on the right side (we - won't know until we're done where the dividing line between the sides - is), then sort those two sides. + the subject array slice and everything greater than is on the right + side and elements equal could be on either side (we won't know until + we're done where the dividing line between the sides is), then sort + those two sides. */ assert(left <= right); @@ -259,8 +260,10 @@ sort(struct PixelType * const pixelType, --j; if (i <= j) { - /* A pixel not less popular than pivot is to the left of a pixel - less popular than pivot, so swap them. + /* An element not less popular than pivot is to the left of a + pixel not more popular than pivot, so swap them. Note that we + could be swapping equal (pivot-valued) elements. Though the + swap isn't necessary, moving 'i' and 'j' is. */ swapPixelType(pixelType, i, j); ++i; -- cgit 1.4.1