D12659: two new UDS structures

Stefan BrĂ¼ns noreply at phabricator.kde.org
Wed May 2 16:32:13 UTC 2018


bruns added inline comments.

INLINE COMMENTS

> udsentry_benchmark.cpp:467
> +        inline Field(const uint index, long long value = 0) : m_long(value), m_index(index) { }
> +        // This operator is essential to gain some speed, because the default == is slow
> +        inline bool operator == (const Field &other) {

The default `==` will not only compare the key, but also the value (thats the reason for being slow), so you have completely different behaviour. When comparing only the index, you will update the value for an existing key, otherwise you will append a new value to the same key.

REPOSITORY
  R241 KIO

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

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


More information about the Kde-frameworks-devel mailing list