diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 04:24:55 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 04:24:55 +0000 |
commit | 0e6f8b166d6155503bf490a9853c0f0c2fbd135b (patch) | |
tree | deab446e920848666726f657fb0cbd4924a0b068 /enc/unicode.c | |
parent | c2355aefc99a03b8f42d2fca44c08983bdbdd087 (diff) |
* enc/unicode/case-folding.rb, casefold.h: Removing data for idempotent
titlecasing.
* enc/unicode.c: Adjust code to data removal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
-rw-r--r-- | enc/unicode.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/enc/unicode.c b/enc/unicode.c index 5c96448259..1b1c92bac8 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -704,7 +704,11 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, } } else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */ - if (flags&OnigCaseFoldFlags(folded->n)) { + if ((flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, */ + && (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* BUT alread titlecase */ + /* already titlecase, no changes needed */ + } + else if (flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */ const OnigCodePoint *next; int count; @@ -712,13 +716,7 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP, if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) { /* special */ OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n); - if ((OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) /* titlecase available, */ - && (flags&ONIGENC_CASE_TITLECASE) /* AND titlecase needed, */ - && (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* BUT alread titlecase */ - flags ^= ONIGENC_CASE_MODIFIED; - goto SpecialsCopy; - } - else if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* Titlecase available */ + if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* titlecase available */ if (flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, but not yet titlecase */ goto SpecialsCopy; else /* Titlecase not needed */ |