]> Savannah Git Hosting - gnulib.git/commitdiff
localcharset: Optimize.
authorBruno Haible <bruno@clisp.org>
Sun, 20 May 2018 10:59:01 +0000 (12:59 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 20 May 2018 11:16:29 +0000 (13:16 +0200)
* lib/localcharset.c (alias_table): Comment out no-op mappings for
platforms where these don't matter. This reduces the table size,
which in turn reduces the lookup time.

ChangeLog
lib/localcharset.c

index 8a02c1abe516deaa1907255206e2bd3d6d831a62..86c2863e845d96face54642dddd4c6a8a6301797 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-05-20  Bruno Haible  <bruno@clisp.org>
+
+       localcharset: Optimize.
+       * lib/localcharset.c (alias_table): Comment out no-op mappings for
+       platforms where these don't matter. This reduces the table size,
+       which in turn reduces the lookup time.
+
 2018-05-19  Bruno Haible  <bruno@clisp.org>
 
        localcharset: Map the locale encodings found in newer OSes.
index 60c320aa2fb4686b9cad4e3076ed23e5caf90415..a51eb0b5e2d6f5038e1f081f9f36eaeec71f7e01 100644 (file)
@@ -90,15 +90,15 @@ struct table_entry
 static const struct table_entry alias_table[] =
   {
 #  if defined __FreeBSD__                                   /* FreeBSD */
-    { "ARMSCII-8",  "ARMSCII-8" },
+  /*{ "ARMSCII-8",  "ARMSCII-8" },*/
     { "Big5",       "BIG5" },
     { "C",          "ASCII" },
-    { "CP1131",     "CP1131" },
-    { "CP1251",     "CP1251" },
-    { "CP866",      "CP866" },
-    { "GB18030",    "GB18030" },
-    { "GB2312",     "GB2312" },
-    { "GBK",        "GBK" },
+  /*{ "CP1131",     "CP1131" },*/
+  /*{ "CP1251",     "CP1251" },*/
+  /*{ "CP866",      "CP866" },*/
+  /*{ "GB18030",    "GB18030" },*/
+  /*{ "GB2312",     "GB2312" },*/
+  /*{ "GBK",        "GBK" },*/
   /*{ "ISCII-DEV",  "?" },*/
     { "ISO8859-1",  "ISO-8859-1" },
     { "ISO8859-13", "ISO-8859-13" },
@@ -107,8 +107,8 @@ static const struct table_entry alias_table[] =
     { "ISO8859-5",  "ISO-8859-5" },
     { "ISO8859-7",  "ISO-8859-7" },
     { "ISO8859-9",  "ISO-8859-9" },
-    { "KOI8-R",     "KOI8-R" },
-    { "KOI8-U",     "KOI8-U" },
+  /*{ "KOI8-R",     "KOI8-R" },*/
+  /*{ "KOI8-U",     "KOI8-U" },*/
     { "SJIS",       "SHIFT_JIS" },
     { "US-ASCII",   "ASCII" },
     { "eucCN",      "GB2312" },
@@ -118,13 +118,13 @@ static const struct table_entry alias_table[] =
 #  endif
 #  if defined __NetBSD__                                    /* NetBSD */
     { "646",        "ASCII" },
-    { "ARMSCII-8",  "ARMSCII-8" },
-    { "BIG5",       "BIG5" },
+  /*{ "ARMSCII-8",  "ARMSCII-8" },*/
+  /*{ "BIG5",       "BIG5" },*/
     { "Big5-HKSCS", "BIG5-HKSCS" },
-    { "CP1251",     "CP1251" },
-    { "CP866",      "CP866" },
-    { "GB18030",    "GB18030" },
-    { "GB2312",     "GB2312" },
+  /*{ "CP1251",     "CP1251" },*/
+  /*{ "CP866",      "CP866" },*/
+  /*{ "GB18030",    "GB18030" },*/
+  /*{ "GB2312",     "GB2312" },*/
     { "ISO8859-1",  "ISO-8859-1" },
     { "ISO8859-13", "ISO-8859-13" },
     { "ISO8859-15", "ISO-8859-15" },
@@ -132,9 +132,9 @@ static const struct table_entry alias_table[] =
     { "ISO8859-4",  "ISO-8859-4" },
     { "ISO8859-5",  "ISO-8859-5" },
     { "ISO8859-7",  "ISO-8859-7" },
-    { "KOI8-R",     "KOI8-R" },
-    { "KOI8-U",     "KOI8-U" },
-    { "PT154",      "PT154" },
+  /*{ "KOI8-R",     "KOI8-R" },*/
+  /*{ "KOI8-U",     "KOI8-U" },*/
+  /*{ "PT154",      "PT154" },*/
     { "SJIS",       "SHIFT_JIS" },
     { "eucCN",      "GB2312" },
     { "eucJP",      "EUC-JP" },
@@ -216,7 +216,7 @@ static const struct table_entry alias_table[] =
 #   define alias_table_defined
 #  endif
 #  if defined _AIX                                          /* AIX */
-    { "GBK",        "GBK" },
+  /*{ "GBK",        "GBK" },*/
     { "IBM-1046",   "CP1046" },
     { "IBM-1124",   "CP1124" },
     { "IBM-1129",   "CP1129" },
@@ -240,7 +240,7 @@ static const struct table_entry alias_table[] =
     { "ISO8859-8",  "ISO-8859-8" },
     { "ISO8859-9",  "ISO-8859-9" },
     { "TIS-620",    "TIS-620" },
-    { "UTF-8",      "UTF-8" },
+  /*{ "UTF-8",      "UTF-8" },*/
     { "big5",       "BIG5" }
 #   define alias_table_defined
 #  endif
@@ -289,7 +289,7 @@ static const struct table_entry alias_table[] =
 #   define alias_table_defined
 #  endif
 #  if defined __osf__                                       /* OSF/1 */
-    { "GBK",        "GBK" },
+  /*{ "GBK",        "GBK" },*/
     { "ISO8859-1",  "ISO-8859-1" },
     { "ISO8859-15", "ISO-8859-15" },
     { "ISO8859-2",  "ISO-8859-2" },
@@ -301,7 +301,7 @@ static const struct table_entry alias_table[] =
     { "KSC5601",    "CP949" },
     { "SJIS",       "SHIFT_JIS" },
     { "TACTIS",     "TIS-620" },
-    { "UTF-8",      "UTF-8" },
+  /*{ "UTF-8",      "UTF-8" },*/
     { "big5",       "BIG5" },
     { "cp850",      "CP850" },
     { "dechanyu",   "DEC-HANYU" },
@@ -317,10 +317,10 @@ static const struct table_entry alias_table[] =
 #  if defined __sun                                         /* Solaris */
     { "5601",        "EUC-KR" },
     { "646",         "ASCII" },
-    { "BIG5",        "BIG5" },
+  /*{ "BIG5",        "BIG5" },*/
     { "Big5-HKSCS",  "BIG5-HKSCS" },
     { "GB18030",     "GB18030" },
-    { "GBK",         "GBK" },
+  /*{ "GBK",         "GBK" },*/
     { "ISO8859-1",   "ISO-8859-1" },
     { "ISO8859-11",  "TIS-620" },
     { "ISO8859-13",  "ISO-8859-13" },
@@ -335,7 +335,7 @@ static const struct table_entry alias_table[] =
     { "ISO8859-9",   "ISO-8859-9" },
     { "PCK",         "SHIFT_JIS" },
     { "TIS620.2533", "TIS-620" },
-    { "UTF-8",       "UTF-8" },
+  /*{ "UTF-8",       "UTF-8" },*/
     { "ansi-1251",   "CP1251" },
     { "cns11643",    "EUC-TW" },
     { "eucJP",       "EUC-JP" },