diff --git a/pdfminer/layout.py b/pdfminer/layout.py index 14383f1..7e0f312 100644 --- a/pdfminer/layout.py +++ b/pdfminer/layout.py @@ -609,8 +609,8 @@ class LTLayoutContainer(LTContainer): group = LTTextGroupLRTB([obj1,obj2]) plane.remove(obj1) plane.remove(obj2) - dists = [ (c,d,o1,o2) for (c,d,o1,o2) in dists - if o1 in plane and o2 in plane ] + # this line is optimized -- don't change without profiling + dists = [ n for n in dists if n[2] in plane._objs and n[3] in plane._objs ] for other in plane: dists.append((0, dist(group,other), group, other)) dists.sort()