GNOME Bugzilla – Bug 610367
[memindex] might busy loop upon EXACT lookup
Last modified: 2010-02-18 16:26:42 UTC
Created attachment 154140 [details] [review] Fix loop by avoiding loop altogether Subject says most, if a sufficiently adequate entry is not found when doing a LOOKUP_EXACT, it might end up in a never ending while (). Attached patch should fix according to semantics (afaics). I am also not entirely clear on how doing g_list_next or g_list_previous on an unsorted list [*] is likely to end up with desired/optimal result ? [*] though in typical cases it will probably end up sort-of sorted descending, in which case list walk would match that
Created attachment 154142 [details] [review] Avoid loop when needed Erm, slight confusion, this one should fix with expected semantics.
No idea about the next/prev, but it'd be good to fix the busy loop, so please commit. (Any reason to check the flags twice though instead of moving the method check inside the if flags block?)
No particular reason for checking twice. So you would prefer a nested if?
Created attachment 154149 [details] [review] Avoid loop when needed ... slick style this time.
commit 2aea9ad231a6b3e9e8846d7e4fde098c5e15af70 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu Feb 18 17:15:35 2010 +0100 memindex: avoid busy loop when doing EXACT lookup Fixes #610367.