Fix whitespace

This commit is contained in:
Thomas Goyne 2014-12-14 08:19:22 -08:00
parent e72ab0eda8
commit 878fd4453b
1 changed files with 15 additions and 15 deletions

View File

@ -49,28 +49,28 @@ namespace {
/// @brief Map a user-friendly encoding name to the real encoding name /// @brief Map a user-friendly encoding name to the real encoding name
const char *get_real_encoding_name(const char *name) { const char *get_real_encoding_name(const char *name) {
struct pair { const char *pretty; const char *real; }; struct pair { const char *pretty; const char *real; };
static pair pretty_names[] = { static pair pretty_names[] = {
# define ADD(pretty, real) pair{pretty, real}, # define ADD(pretty, real) pair{pretty, real},
# include <libaegisub/charsets.def> # include <libaegisub/charsets.def>
# undef ADD # undef ADD
}; };
static bool init = false; static bool init = false;
if (!init) { if (!init) {
init = true; init = true;
boost::sort(pretty_names, [](pair a, pair b) { boost::sort(pretty_names, [](pair a, pair b) {
return strcmp(a.pretty, b.pretty) < 0; return strcmp(a.pretty, b.pretty) < 0;
}); });
} }
auto enc = boost::lower_bound(pretty_names, name, [](pair a, const char *b) { auto enc = boost::lower_bound(pretty_names, name, [](pair a, const char *b) {
return strcmp(a.pretty, b) < 0; return strcmp(a.pretty, b) < 0;
}); });
if (enc != std::end(pretty_names) && strcmp(enc->pretty, name) == 0) if (enc != std::end(pretty_names) && strcmp(enc->pretty, name) == 0)
return enc->real; return enc->real;
return name; return name;
} }
size_t get_bom_size(Iconv& cd) { size_t get_bom_size(Iconv& cd) {