Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better options for enmuerate CFStrorage items (via IEnumerable<>) #58

Open
kucint opened this issue Sep 4, 2019 · 0 comments
Open

Comments

@kucint
Copy link

kucint commented Sep 4, 2019

Hi,
although you provide a method for query children items (void VisitEntries(Action<CFItem> action, bool recursive)), it has some significant drawbacks:

  • it is impossible to build an effective query, because the loop VisitEntries cannot be interrupted when the query is already satisfied. it must go always through all elements even if it no longer necessary.
  • it is impossible to use System.Linq to build complex queries on nodes.

The solution would be an implementation of IEnumerable<>. Have look on System.IO.Directory. it has to enumerate as well its sub-Folders and files and it returns IEnumerable<>.

Suggestion: Add following methods to CFStorage:

  • IEnumerable<CFItem> EnumerateItems(bool recursive);
    The implementation must use yield operator in order to cooperate smoothly with System.Linq without causing any redundant allocations.

best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant