You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Hi,
although you provide a method for query children items (
void VisitEntries(Action<CFItem> action, bool recursive)
), it has some significant drawbacks:VisitEntries
cannot be interrupted when the query is already satisfied. it must go always through all elements even if it no longer necessary.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 withSystem.Linq
without causing any redundant allocations.best!
The text was updated successfully, but these errors were encountered: