influxdb-client-csharp
influxdb-client-csharp copied to clipboard
feat: Use IEnumerable in WriteApi to eliminate unnecessary memory all…
Proposed Changes
Change WriteApi to use IEnumerable for collection arguments instead of List.
Change WriteRecords(List<string> records)
to WriteRecords(IEnumerable<string> records)
Calling ToList on a collection will incur a memory allocation as the data is copied to the new list. Making the argument IEnumerable means ToList doesn't need to be called and so no extra memory allocation.
Internally this will eliminate the unnecessary memory allocation in WriteRecords(string[] record)
call to ToList, and client code also won't have to make the allocation if their data isn't already in a List## Checklist
Checklist
- [x] CHANGELOG.md updated
- [x] Rebased/mergeable
- [x] A test has been added if appropriate
- [ ]
dotnet test
completes successfully - [x] Commit messages are conventional
- [x] Sign CLA (if not already signed)