Skip to content

Commit

Permalink
Refactor flattening
Browse files Browse the repository at this point in the history
  • Loading branch information
koenedaele committed May 10, 2016
1 parent 910c8b8 commit 1aad74a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pyramid_skosprovider/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from __future__ import unicode_literals

import itertools

from pyramid.view import view_config, view_defaults

from pyramid.compat import ascii_native_
Expand Down Expand Up @@ -155,10 +157,7 @@ def get_concepts(self):
language=language
)
# Flatten it all
cs = []
for c in concepts:
cs += c['concepts']
concepts = cs
concepts = list(itertools.chain.from_iterable([c['concepts'] for c in concepts]))

if postprocess:
concepts = self._postprocess_wildcards(concepts, label)
Expand Down

0 comments on commit 1aad74a

Please sign in to comment.