mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
Use lookup table for 1-char strings, not std::map for string_pool.
This commit is contained in:
@@ -100,6 +100,11 @@ typedef std::set<StringPoolItem> StringPool;
|
||||
const char *string_pool_insert_len(const char *s, int len)
|
||||
{
|
||||
static StringPool pool;
|
||||
if (len == 0)
|
||||
return "";
|
||||
else if (len == 1)
|
||||
return cp_char2str(*s);
|
||||
|
||||
StringPoolItem spi (s, len);
|
||||
|
||||
StringPool::iterator it = pool.insert(spi).first;
|
||||
|
||||
Reference in New Issue
Block a user