shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

refactor: use HashMap for "parsing" numeric Content-Formats #125

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

This PR refactors the creation of CoapMediaTypes from numeric values by using a HashMap as a registry instead of iterating over all values. This should somewhat increase the performance, as CoapMediaTypes can now be determined with constant instead of linear complexity.