* enc/unicode.c: Eliminating common code.
(with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8679f113e9
commit
e89232eb15
@ -1,3 +1,8 @@
|
|||||||
|
Tue Mar 15 16:29:51 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
|
* enc/unicode.c: Eliminating common code.
|
||||||
|
(with Kimihito Matsui)
|
||||||
|
|
||||||
Tue Mar 15 16:17:09 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Tue Mar 15 16:17:09 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* enc/unicode.c: Expansion of some code repetition in preparation for
|
* enc/unicode.c: Expansion of some code repetition in preparation for
|
||||||
|
@ -716,7 +716,6 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
|
|||||||
MODIFIED;
|
MODIFIED;
|
||||||
if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) {
|
if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) {
|
||||||
OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
|
OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
|
||||||
int count;
|
|
||||||
|
|
||||||
if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) {
|
if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) {
|
||||||
if (flags&ONIGENC_CASE_TITLECASE)
|
if (flags&ONIGENC_CASE_TITLECASE)
|
||||||
@ -732,41 +731,26 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
|
|||||||
SpecialsCopy:
|
SpecialsCopy:
|
||||||
count = SpecialsLengthExtract(*SpecialsStart);
|
count = SpecialsLengthExtract(*SpecialsStart);
|
||||||
next = SpecialsStart;
|
next = SpecialsStart;
|
||||||
if (count==1)
|
|
||||||
code = SpecialsCodepointExtract(*next);
|
|
||||||
else if (count==2) {
|
|
||||||
code = SpecialsCodepointExtract(*next++);
|
code = SpecialsCodepointExtract(*next++);
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
|
||||||
code = *next;
|
|
||||||
}
|
|
||||||
else { /* count == 3 */
|
|
||||||
code = SpecialsCodepointExtract(*next++);
|
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
|
||||||
code = *next++;
|
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
|
||||||
code = *next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else { /* no specials */
|
else { /* no specials */
|
||||||
count = OnigCodePointCount(folded->n);
|
count = OnigCodePointCount(folded->n);
|
||||||
next = folded->code;
|
next = folded->code;
|
||||||
if (count==1)
|
|
||||||
code = *next;
|
|
||||||
else if (count==2) {
|
|
||||||
code = *next++;
|
code = *next++;
|
||||||
|
}
|
||||||
|
if (count==1)
|
||||||
|
;
|
||||||
|
else if (count==2) {
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
||||||
code = *next;
|
code = *next;
|
||||||
}
|
}
|
||||||
else { /* count == 3 */
|
else { /* count == 3 */
|
||||||
code = *next++;
|
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
|
||||||
code = *next++;
|
|
||||||
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
to += ONIGENC_CODE_TO_MBC(enc, code, to);
|
||||||
|
to += ONIGENC_CODE_TO_MBC(enc, *next++, to);
|
||||||
code = *next;
|
code = *next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0) {
|
else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0) {
|
||||||
if (flags&OnigCaseFoldFlags(folded->n)) {
|
if (flags&OnigCaseFoldFlags(folded->n)) {
|
||||||
int count = OnigCodePointCount(folded->n);
|
int count = OnigCodePointCount(folded->n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user