D17528: Refactor SlaveInterface::calcSpeed

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sat Dec 15 00:25:10 GMT 2018


bruns added inline comments.

INLINE COMMENTS

> slaveinterface.cpp:102
> +    // Minimum list size is 1 and maximum list size is 8. Delta is calculated
> +    // using first and last item from the list at least every 900 msecs.
> +

.. at most ...

> slaveinterface.cpp:203
>          d->filesize = d->offset;
> -        d->sizes[0] = d->filesize - d->offset;
> -        d->times[0] = 0;
> -        d->nums = 1;
> +        d->transfer_details.append({0, (d->filesize - d->offset)});
>          d->speed_timer.start(1000);

Strange way of writing {0, 0} ...

> dfaure wrote in slaveinterface_p.h:48
> the old "nums" is now the vector size, right?
> 
> nums was initialized to 0, so this should not initialize the vector to max_count items

The result is the same in this case - after 7 seconds, the initial items are shifted out of the array. During these 7 seconds, the first element is always {0, 0}. It does not matter if last() is the 2nd or 7th element.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D17528

To: chinmoyr, dfaure
Cc: bruns, kde-frameworks-devel, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181215/ec823e7d/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list