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

Stop multiple enumeration of items #96

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

smithkl42
Copy link

The code for bulk insertion currently iterates through the items twice: once when counting them to determine batch size, and once when actually inserting them. This is more-or-less harmless for a List<T> datasource, but is problematic when you're generating items (as I was) via a yield return kind of construct. I don't think that there's any problem with having a batch size larger than the actual batch, so the simplest way to handle it was just to stop the first (counting) iteration.

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

Successfully merging this pull request may close these issues.

1 participant