Deduplicate case-insensitive functors (#2697)

This commit is contained in:
Andrew Gaul
2025-07-29 22:28:06 +09:00
committed by GitHub
parent 41ef4b6495
commit 57b5d367f2

View File

@ -23,20 +23,14 @@
#include <map>
#include <string>
#include <strings.h>
#include <sys/stat.h>
#include "types.h"
//-------------------------------------------------------------------
// headers_t
//-------------------------------------------------------------------
struct header_nocase_cmp
{
bool operator()(const std::string &strleft, const std::string &strright) const
{
return (strcasecmp(strleft.c_str(), strright.c_str()) < 0);
}
};
typedef std::map<std::string, std::string, header_nocase_cmp> headers_t;
typedef std::map<std::string, std::string, case_insensitive_compare_func> headers_t;
//-------------------------------------------------------------------
// Functions