kotlin icon indicating copy to clipboard operation
kotlin copied to clipboard

KT-18629 Add BFS File walking.

Open aivinog1 opened this issue 6 years ago • 9 comments

https://youtrack.jetbrains.com/issue/KT-18629

aivinog1 avatar Mar 29 '19 04:03 aivinog1

Also, it would be nice if the merge commits would be removed from this PR for more convenient commit-wise review.

sschuberth avatar Mar 29 '19 08:03 sschuberth

I wonder what are the use cases for bottom-up breadth first search?

ilya-g avatar Apr 08 '19 09:04 ilya-g

I wonder what are the use cases for bottom-up breadth first search?

This is a good question.

Also, it would be nice if the merge commits would be removed from this PR for more convenient commit-wise review.

Done.

aivinog1 avatar Apr 08 '19 09:04 aivinog1

I propose making BFS top-down visiting order just another entry in FileWalkDirection enum. This way it will require much less changes in the public API surface.

As to bottom-up BFS visitor — it could be postponed until its use cases are clear.

ilya-g avatar Apr 08 '19 15:04 ilya-g

@ihdadi3 please use English.

ilya-g avatar Apr 14 '19 16:04 ilya-g

I propose making BFS top-down visiting order just another entry in FileWalkDirection enum. This way it will require much less changes in the public API surface.

As to bottom-up BFS visitor — it could be postponed until its use cases are clear.

I'm agree with you.

aivinog1 avatar Apr 15 '19 03:04 aivinog1

I wonder what are the use cases for bottom-up breadth first search?

See e.g. the discussion at https://github.com/heremaps/oss-review-toolkit/pull/1903#discussion_r341245108 for a use-case.

sschuberth avatar Nov 01 '19 09:11 sschuberth

@sschuberth I've skimmed through the discussion, but haven't got an idea how the described use case is different from the regular BFS. And I wondered originally about the bottom-up BFS. In DFS, the bottom-up and top-down walk orders differ only in a way how directory entries are visited compared to their nested file entries. In the referenced case the author filters the visited directory entries out with .filter { it.isFile }, so it doesn't matter in which order they were visited.

ilya-g avatar Nov 05 '19 18:11 ilya-g

Sorry, you're right @ilya-g. I didn't get that the emphasis was on bottom-up, not on BFS in general. The discussion I referred to only explains the use-case for BFS vs. DFS.

sschuberth avatar Nov 05 '19 21:11 sschuberth