Fix infinite loop guard in case of duplicate UIDs
Summary:
In this case the prenodeByUid hash will not increase its size (thus not
fulfilling the outer loop condition), but an element is found nevertheless
(thus not triggering the loop guard). Now both use the same condition.
Reviewers: mlaurent
Reviewed By: mlaurent
Subscribers: kde-pim
Tags: KDE PIM
Differential Revision: https://phabricator.kde.org/D21518