aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-28 05:54:47 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-28 05:54:47 +0000
commit2d20a27fb4ee8d3401627e538cb68019704d7bae (patch)
treefb7caa30404a74e752ed5d48098d6d1a99e84a61
parent890ce36b797fe3e91d039f5fafcba3681f342557 (diff)
downloadruby-2d20a27fb4ee8d3401627e538cb68019704d7bae.tar.gz
* enc/unicode.c: Refactoring in preparation for data reduction for
titlecase. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--enc/unicode.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 93b2560e39..d8fe1c23f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 28 14:54:49 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
+
+ * enc/unicode.c: Refactoring in preparation for data reduction for
+ titlecase.
+
Mon Mar 28 14:36:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/unicode.c: Minor refactoring for I WITH DOT ABOVE.
diff --git a/enc/unicode.c b/enc/unicode.c
index e51c2a1363..5c96448259 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -712,12 +712,15 @@ 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 */
- if (flags&ONIGENC_CASE_TITLECASE) { /* titlecase needed */
- if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE) /* alread titlecase */
- flags ^= ONIGENC_CASE_MODIFIED;
+ 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 (flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, but not yet titlecase */
goto SpecialsCopy;
- }
else /* Titlecase not needed */
SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
}