summaryrefslogtreecommitdiff
path: root/enc/unicode.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-15 07:17:09 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-15 07:17:09 +0000
commit8679f113e949e2484f105fa27a1334342c244b3c (patch)
treed6e6b09d0e4f2bacecf4d5d63f48e67a5f113bd0 /enc/unicode.c
parented921b85dc25a31a36f2614b8b64691f69c67f1e (diff)
* enc/unicode.c: Expansion of some code repetition in preparation for
elimination of common code pieces. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/unicode.c')
-rw-r--r--enc/unicode.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/enc/unicode.c b/enc/unicode.c
index 5a46982a5e..a52bb3324c 100644
--- a/enc/unicode.c
+++ b/enc/unicode.c
@@ -725,9 +725,7 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
}
if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_DOWN_SPECIAL) {
- if (flags&ONIGENC_CASE_DOWN_SPECIAL)
- goto SpecialsCopy;
- else
+ if (!(flags&ONIGENC_CASE_DOWN_SPECIAL))
SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
}
/* if we pass here, we know we use special upcasing, and are at the right position */
@@ -737,12 +735,15 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
if (count==1)
code = SpecialsCodepointExtract(*next);
else if (count==2) {
- to += ONIGENC_CODE_TO_MBC(enc, SpecialsCodepointExtract(*next++), to);
+ code = SpecialsCodepointExtract(*next++);
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
code = *next;
}
else { /* count == 3 */
- to += ONIGENC_CODE_TO_MBC(enc, SpecialsCodepointExtract(*next++), to);
- to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+ code = SpecialsCodepointExtract(*next++);
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
+ code = *next++;
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
code = *next;
}
}
@@ -752,12 +753,15 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
if (count==1)
code = *next;
else if (count==2) {
- to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+ code = *next++;
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
code = *next;
}
else { /* count == 3 */
- to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
- to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
+ code = *next++;
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
+ code = *next++;
+ to += ONIGENC_CODE_TO_MBC(enc, code, to);
code = *next;
}
}