File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 22
33## 1.2.0
44
5- * The ` mmdbtype.Unmarshaler ` now caches nested structures (Maps, Slices, and
6- Uint128 values) in addition to top-level values. This improves performance
7- when loading databases with shared nested data structures. Simple scalar types
8- are intentionally not cached as they are cheap to decode and caching would
9- waste memory and CPU cycles.
5+ * The ` mmdbtype.Unmarshaler ` now caches nested structures, maps and slices,
6+ in addition to top-level values. This improves performance when loading
7+ databases with shared nested data structures.
108* The zero value of ` mmdbtype.Unmarshaler ` is now documented as safe to use
119 for unmarshaling without caching enabled. Use ` NewUnmarshaler() ` when you
1210 want caching.
Original file line number Diff line number Diff line change @@ -964,7 +964,7 @@ func isCacheableKind(kind mmdbdata.Kind) bool {
964964
965965// decodeDataTypeValue decodes a value from the decoder and returns the appropriate DataType.
966966// If cache is provided (non-nil), it will check for cached values at the current decoder offset
967- // and store newly decoded complex types (Map, Slice, Uint128 ) in the cache. Simple scalar types
967+ // and store newly decoded container types (Map, Slice) in the cache. Simple scalar types
968968// are not cached as they are cheap to decode and caching them would waste memory.
969969func decodeDataTypeValue (decoder * mmdbdata.Decoder , cache map [uint ]DataType ) (DataType , error ) {
970970 kind , err := decoder .PeekKind ()
You can’t perform that action at this time.
0 commit comments