From 3aa0cc1751dca78b38d49dbaab4156320fa908fc Mon Sep 17 00:00:00 2001 From: Serge Lamikhov-Center Date: Wed, 22 Aug 2012 22:50:03 +0300 Subject: [PATCH] Align format_assoc() implementation to its specialization version --- elfio/elfio_dump.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/elfio/elfio_dump.hpp b/elfio/elfio_dump.hpp index 172596e..d8b95cb 100644 --- a/elfio/elfio_dump.hpp +++ b/elfio/elfio_dump.hpp @@ -610,10 +610,13 @@ class dump format_assoc( const T& table, const K& key ) { std::string str = find_value_in_table( table, key ); - std::ostringstream oss; - oss << str << " (0x" << std::hex << key << ")"; + if ( str == "UNKNOWN" ) { + std::ostringstream oss; + oss << str << " (0x" << std::hex << key << ")"; + str = oss.str(); + } - return oss.str(); + return str; } @@ -659,7 +662,7 @@ class dump template< typename T > \ static \ std::string \ - str_##name( T key ) \ + str_##name( const T key ) \ { \ return format_assoc( name##_table, key ); \ }