Date: Tue, 9 Jul 2013 10:16:38 GMT From: mattbw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r254488 - soc2013/mattbw/backend/query Message-ID: <201307091016.r69AGcmm017659@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mattbw Date: Tue Jul 9 10:16:38 2013 New Revision: 254488 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=254488 Log: hopefully fix horrendously broken percentage code Modified: soc2013/mattbw/backend/query/core.c Modified: soc2013/mattbw/backend/query/core.c ============================================================================== --- soc2013/mattbw/backend/query/core.c Tue Jul 9 10:00:21 2013 (r254487) +++ soc2013/mattbw/backend/query/core.c Tue Jul 9 10:16:38 2013 (r254488) @@ -223,14 +223,13 @@ if (percent > 100) percent = 100; - scaled_percent = (((100 * q->s->position) + - (percent * (q->s->position + 1))) / (q->s->total)); + scaled_percent = (((100 * q->s->position) + percent) / + (q->s->total)); } (void)pk_backend_set_percentage(q->backend, scaled_percent); } - /* * Checks to see if trying to do a remote package iteration with this query * could spell disaster.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307091016.r69AGcmm017659>