Don't iterate iterable arguments twice in PbList (#1070) Update `PbList` methods that update the list with an `Iterable` argument to avoid iterating the iterable twice: once for checking the element validity and once again for actually adding the values. Methods updated: - addAll - insertAll - replaceRange - setAll - setRange Exception handling behavior before this PR was undefined (same as the standard library `List`), and it's slightly changed with this PR: - addAll: previously if the iterator throws the list was left unchanged, now the elements until the exception will be added. - Other methods: exception behaviors are now the same as the standard library `List` methods. It's hard to tell whether the previous behavior was the same or different with the standard library `List` methods, as the exception behavior of those are undefined. To avoid allocating new iterators when a check function is not available, we have conditionals in each of these methods and call the standard library `List` methods directly when there isn't a check function. To avoid increasing number of cases needed to be tested, we don't special case iterable types like `PbList` and `List` in these methods. When the check function is available we simply `map` them with the check function. Otherwise call the same method on `wrappedList` directly. Fixes #730.
Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.
This repository is home to packages related to protobuf support for Dart.
| Package | Description | Published Version |
|---|---|---|
| protobuf | Runtime library for protocol buffers support. | |
| protoc_plugin | A protobuf protoc compiler plugin used to generate Dart code. | |
| benchmarks | Benchmarks for various protobuf functions. |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.