D26226: [KListOpenFilesJob] Use QString::splitRef()

Ahmad Samir noreply at phabricator.kde.org
Thu Dec 26 10:09:25 GMT 2019


ahmadsamir planned changes to this revision.
ahmadsamir marked an inline comment as done.
ahmadsamir added inline comments.

INLINE COMMENTS

> dfaure wrote in klistopenfilesjob_unix.cpp:71
> This does not work the way you think it does.
> 
> "A call to std::unique is typically followed by a call to a container's erase method, which erases the unspecified values and reduces the physical size of the container to match its new logical size."
> 
> Also, note that unlike removeDuplicates(), std::unique requires the container to be sorted (or at least the duplicates to be consecutive). But AFAICS the output of lsof is already sorted? In fact in all my tests I don't manage to see it output duplicates... Are you sure this can happen?

Ouch, right; I should have read up fully on unique before using it (I skimmed the docs, always a stupid idea with a new tool).

removeDuplicates() was in the original code; and `lsof` would have duplicate pids, but I missed that the code actually uses `lsof -t` which is both sorted and unique.

I'll investigate some more and update the diff.

REPOSITORY
  R244 KCoreAddons

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

To: ahmadsamir, #frameworks, mpyne, dfaure, apol
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191226/18c83d2b/attachment.html>


More information about the Kde-frameworks-devel mailing list