Merge lp:~ken-vandine/gwibber/lp_959068 into lp:gwibber

Proposed by Ken VanDine
Status: Superseded
Proposed branch: lp:~ken-vandine/gwibber/lp_959068
Merge into: lp:gwibber
Diff against target: 21 lines (+6/-3)
1 file modified
libgwibber/streams.vala (+6/-3)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/lp_959068
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+100784@code.launchpad.net

This proposal has been superseded by a proposal from 2012-04-04.

Description of the change

Don't try to iterate over the seen HashMap if it isn't empty (LP: #959068)

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

As discussed on IRC, the change seems harmless. Might warrant a comment in code, because otherwise that coding pattern is odd and liable to be removed accidentally in future.

review: Approve
lp:~ken-vandine/gwibber/lp_959068 updated
1334. By Ken VanDine

Defer calling unset on the seen HashMap until after we are done iterating it,
it will resize making the iterator invalid. (LP: #959068)

This is fixed in the 0.7 series of libgee https://bugzilla.gnome.org/show_bug.cgi?id=671327

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgwibber/streams.vala'
2--- libgwibber/streams.vala 2012-03-19 13:35:30 +0000
3+++ libgwibber/streams.vala 2012-04-04 13:26:36 +0000
4@@ -213,11 +213,14 @@
5 model = create_model ();
6 }
7 model.row_removed.connect((_m, _i) => {
8- foreach (var v in seen.entries)
9+ if (seen.size > 0)
10 {
11- if (v.value == _i)
12+ foreach (var v in seen.entries)
13 {
14- seen.unset(v.key);
15+ if (v.value == _i)
16+ {
17+ seen.unset(v.key);
18+ }
19 }
20 }
21 });