Iterators & Configuration.Find(regexp)#568
Conversation
|
@dahlbyk Wow.. Thanks for this one! ed7f523 has been cherry picked. Aren't we supposed to see traces in the console log when we forget to dispose a native handle? That's a bit strange. I can't remember having seen any of those. Regarding the iterator proposal, I'm a bit on the fence here. The solution is elegant, but as it's lazily evaluated, we may face issues when things change, behind the scene, on the disk. I think I'd prefer to eagerly retrieve everything that's stored in a mutable state (eg. index, config, references, ...). |
|
A well-placed ToList should force evaluation - should that call live in Proxy? |
|
Added I'm now looking at maybe refactoring this to allow us to use the branch type... |
Please make the branch also eagerly retrieved. They're currently lazy now because of the breaking changes I've had to cope with during the last libgit2 upgrade. |
Done. Also adjusted iterator pattern to support returning an arbitrary payload |
There was a problem hiding this comment.
Could you please make this IEnumerable<> and rely on Count() in the tests?
There was a problem hiding this comment.
Also I'm not sure I like .Match() as a method name.
.Match makes sense on a Regexp type, however I think that .Find() may be more discoverable on this kind of Collection.
|
Once you're done with my latest nitpick, could you please rebase (tidying the history a little bit ;-) ) so that we can merge this 💎? |
|
😍 🤘 |
First pass at a common pattern for iterators.
ed7f523 is unrelated and can probably be cherry-picked on its own.