D9983: Don't stat(/etc/localtime) between read() and write() copying files

David Faure noreply at phabricator.kde.org
Wed Jan 24 08:35:10 UTC 2018


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> slavebase.cpp:1052
>      } else if (timeout == 0) {
> -        d->nextTimeout = QDateTime::currentDateTime().addSecs(1);    // Immediate timeout
> +        d->nextTimeoutMsecs = 1000;  // Inmediate timeout
>      } else {

Typo: In -> Im (i.e. it was correct in the orig code)

> slavebase.cpp:1054
>      } else {
> -        d->nextTimeout = QDateTime();    // Canceled
> +        d->nextTimeoutMsecs = 1;
> +        d->nextTimeout.invalidate(); // Canceled

Where does this "1" value come from, and it is useful at all?

> slavebase.cpp:1055
> +        d->nextTimeoutMsecs = 1;
> +        d->nextTimeout.invalidate(); // Canceled
>      }

So when we go to that "else" branch, we'll have called start() and immediately after, invalidate(). To avoid doing this, how about calling start() in the first two if()s?
(small optimization)

REPOSITORY
  R241 KIO

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

To: jtamate, #frameworks, dfaure
Cc: fvogt, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180124/a40ccc41/attachment.html>


More information about the Kde-frameworks-devel mailing list