summaryrefslogtreecommitdiff
path: root/utf8proc.c
diff options
context:
space:
mode:
authorMichaël Meyer <hierophanie@gmail.com>2015-12-09 19:55:48 +0100
committerMichaël Meyer <hierophanie@gmail.com>2015-12-09 19:55:48 +0100
commit26436c9775e36ec9f608574b87626de139b345ba (patch)
treeab3a7fbd14a0c7ca5b6d0725423ba27d3118eed2 /utf8proc.c
parent6b510deff274dc79b4e324abef5fbb45a8162861 (diff)
downloadlibutf8proc-26436c9775e36ec9f608574b87626de139b345ba.tar.gz
libutf8proc-26436c9775e36ec9f608574b87626de139b345ba.tar.bz2
Reduce the size of the binary.
Use integers instead of pointers in Unicode tables. Saves 226 kb / 716 kb in the compiled library.
Diffstat (limited to 'utf8proc.c')
-rw-r--r--utf8proc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utf8proc.c b/utf8proc.c
index 1f17730..ab23a87 100644
--- a/utf8proc.c
+++ b/utf8proc.c
@@ -357,10 +357,10 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc,
category == UTF8PROC_CATEGORY_ME) return 0;
}
if (options & UTF8PROC_CASEFOLD) {
- if (property->casefold_mapping) {
+ if (property->casefold_mapping != UINT16_MAX) {
const utf8proc_int32_t *casefold_entry;
utf8proc_ssize_t written = 0;
- for (casefold_entry = property->casefold_mapping;
+ for (casefold_entry = &utf8proc_sequences[property->casefold_mapping];
*casefold_entry >= 0; casefold_entry++) {
written += utf8proc_decompose_char(*casefold_entry, dst+written,
(bufsize > written) ? (bufsize - written) : 0, options,
@@ -371,11 +371,11 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(utf8proc_int32_t uc,
}
}
if (options & (UTF8PROC_COMPOSE|UTF8PROC_DECOMPOSE)) {
- if (property->decomp_mapping &&
+ if (property->decomp_mapping != UINT16_MAX &&
(!property->decomp_type || (options & UTF8PROC_COMPAT))) {
const utf8proc_int32_t *decomp_entry;
utf8proc_ssize_t written = 0;
- for (decomp_entry = property->decomp_mapping;
+ for (decomp_entry = &utf8proc_sequences[property->decomp_mapping];
*decomp_entry >= 0; decomp_entry++) {
written += utf8proc_decompose_char(*decomp_entry, dst+written,
(bufsize > written) ? (bufsize - written) : 0, options,