Skip to content

Commit 5240914

Browse files
committed
refactor: use ternary condition for fct_search
1 parent 5870f8f commit 5240914

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pyrdf2vec/walkers/random.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,7 @@ def extract_walks(self, kg: KG, entity: Vertex) -> List[Walk]:
130130
The list of unique walks for the provided entity.
131131
132132
"""
133-
if self.max_walks is None:
134-
fct_search = self._bfs
135-
else:
136-
fct_search = self._dfs
133+
fct_search = self._bfs if self.max_walks is None else self._dfs
137134
if self.with_reverse:
138135
return [
139136
r_walk[:-1] + walk

0 commit comments

Comments
 (0)