Skip to content

Commit 293bf8e

Browse files
committed
Update docs
1 parent 031a64d commit 293bf8e

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
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.

mmdbtype/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.
969969
func decodeDataTypeValue(decoder *mmdbdata.Decoder, cache map[uint]DataType) (DataType, error) {
970970
kind, err := decoder.PeekKind()

0 commit comments

Comments
 (0)