Fix string pool dump

This commit is contained in:
samisalreadytaken 2020-08-30 15:58:07 +03:00
parent c448f194ae
commit 0087e6d734

View File

@ -55,22 +55,12 @@ public:
void Dump( void ) void Dump( void )
{ {
CUtlVector<const char*> strings( 0, m_Strings.Count() );
for (UtlHashHandle_t i = m_Strings.FirstHandle(); i != m_Strings.InvalidHandle(); i = m_Strings.NextHandle(i)) for (UtlHashHandle_t i = m_Strings.FirstHandle(); i != m_Strings.InvalidHandle(); i = m_Strings.NextHandle(i))
{ {
strings.AddToTail( strings[i] ); DevMsg(" %d (0x%p) : %s\n", i, m_Strings[i], m_Strings[i]);
} }
struct _Local { DevMsg("\n");
static int __cdecl F(const char * const *a, const char * const *b) { return strcmp(*a, *b); } DevMsg("Size: %d items\n", m_Strings.Count());
};
strings.Sort( _Local::F );
for ( int i = 0; i < strings.Count(); ++i )
{
DevMsg( " %d (0x%p) : %s\n", i, strings[i], strings[i] );
}
DevMsg( "\n" );
DevMsg( "Size: %d items\n", strings.Count() );
} }
const char *Find(const char *string) const char *Find(const char *string)