From 5d5e3bc47ae1087277a8c21c25e640353d4e37ae Mon Sep 17 00:00:00 2001 From: dadhi Date: Thu, 23 Jun 2022 11:33:16 +0200 Subject: [PATCH] fix the ImHashMap.ToString in DEBUG --- src/ImTools/ImTools.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ImTools/ImTools.cs b/src/ImTools/ImTools.cs index 7c52c0a..3291eaa 100644 --- a/src/ImTools/ImTools.cs +++ b/src/ImTools/ImTools.cs @@ -2076,7 +2076,9 @@ public override string ToString() // for the debug purposes we just output the first N keys in array const int n = 50; var count = this.Count(); - var hashes = this.Enumerate().Take(n).Select(x => x.Hash).ToList(); + var hashes = typeof(K) == typeof(int) + ? ((ImHashMap)(object)this).Enumerate().Take(n).Select(x => x.Hash).ToList() + : this.Enumerate().Take(n).Select(x => x.Hash).ToList(); return $"{{hashes: new int[{(count > n ? $"{n}/{count}" : "" + count)}] {{{(string.Join(", ", hashes))}}}}}"; #else return "{}";