The new implementation:
- Uses map to track unique keys for accurate counting
- Excludes internal built-in keys from total count
- Improves code maintainability
Although this approach uses additional memory for the map, the trade-off
is acceptable since:
- Status() is not in hot path
- Correctness takes priority over performance optimization
- Simpler code is easier to maintain
Fixes#19253
Signed-off-by: Xiang Ji <johnsmith.jix@gmail.com>