protoc_plugin: Improve "is map field" check (#765)

`MessageOptions.map_entry` is an `optional bool` field. Currently to
check whether a field is a map we check whether `map_entry` is present,
but we don't check its value. This only works if the field is never set,
or set to `true` (i.e. it's never set to `false`).

The right way to check it is

    descriptor.options.hasMapEntry() && descriptor.options.mapEntry

because the default value of the field is `false`, this can be
simplified as

    descriptor.options.mapEntry
1 file changed
tree: 532d943cbae69503fc7cc25fdab5ac079cf5ae75
  1. .github/
  2. api_benchmark/
  3. benchmarks/
  4. protobuf/
  5. protoc_plugin/
  6. tool/
  7. .gitignore
  8. AUTHORS
  9. LICENSE
  10. mono_repo.yaml
  11. README.md
README.md

CI status

Protobuf support for Dart

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 for Dart.

PackageDescriptionPublished Version
protobufA support library for the generated codepub package
protoc_pluginA Dart back-end for the protoc compilerpub package
api_benchmarkBenchmarking for various API calls
query_benchmarkBenchmark for encoding and decoding of a “real-world” protobuf