D12696: Use the new uds implementation

Stefan BrĂ¼ns noreply at phabricator.kde.org
Wed May 9 15:28:30 UTC 2018


bruns added inline comments.

INLINE COMMENTS

> kfileitem.cpp:198
>              const QByteArray pathBA = QFile::encodeName(path);
>              if (QT_LSTAT(pathBA.constData(), &buf) == 0) {
> +                m_entry.replace(KIO::UDSEntry::UDS_DEVICE_ID,           buf.st_dev);

m_entry.reserve(9)

> kfileitem.cpp:198
>              const QByteArray pathBA = QFile::encodeName(path);
>              if (QT_LSTAT(pathBA.constData(), &buf) == 0) {
> +                m_entry.replace(KIO::UDSEntry::UDS_DEVICE_ID,           buf.st_dev);

Wouldn't it be better to call m_entry.clear() and m_entry.insert(...) here?

For the call from the constructor, m_entry is empty, so you save the std::find_if() in the replace method calls.

For any other caller, is there any useful info in m_entry() which is still valid when calling init() again?

> udsentry.cpp:184
> +{
> +    s << static_cast<int>(storage.size());
>  

quint32, see ..::load(...) below.

> udsentry.cpp:341
>  {
>      reserve(9);
>      insert(UDS_NAME,                name);

I can count 10 inserts below ...

REPOSITORY
  R241 KIO

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

To: jtamate, dfaure, #frameworks
Cc: kde-frameworks-devel, bruns, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180509/9c2cbb66/attachment.html>


More information about the Kde-frameworks-devel mailing list