[Differential] [Changed Subscribers] D4584: KDirWatch: replace QList<Client *> by std::vector<Client> to save on new/delete.

Milian Wolff noreply at phabricator.kde.org
Sun Feb 12 11:58:45 UTC 2017


mwolff added inline comments.

INLINE COMMENTS

> kdirwatch.cpp:371
>                                  // files in WatchFiles mode with inotify.
>                                  if (isDir) {
>                                      addEntry(client->instance, tpath, nullptr, isDir,

future patch should hoist that out of the loop to not rely on the compiler to do our job

> kdirwatch_p.h:84
> +        // (even though the vector of clients is empty at that point, so no performance penalty there)
> +        //Client(const Client &) = delete;
> +        //Client &operator=(const Client &) = delete;

instead of commenting it out, =default them?

> kdirwatch_p.h:141
>  
> -        QList<Client *> clientsForFileOrDir(const QString &tpath, bool *isDir) const;
> -        QList<Client *> inotifyClientsForFileOrDir(bool isDir) const;
> +        QList<const Client *> clientsForFileOrDir(const QString &tpath, bool *isDir) const;
> +        QList<const Client *> inotifyClientsForFileOrDir(bool isDir) const;

so.. the client is copyable, no? If so, returning a vector<Client> here as well would be much nicer, no?

REPOSITORY
  R244 KCoreAddons

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: dfaure, aacid, mpyne
Cc: mwolff, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170212/972941ad/attachment.html>


More information about the Kde-frameworks-devel mailing list