ruby-changes:53853
From: duerst <ko1@a...>
Date: Wed, 28 Nov 2018 15:44:02 +0900 (JST)
Subject: [ruby-changes:53853] duerst:r66071 (trunk): eliminate intermediate variable in very short block (3 times)
duerst 2018-11-28 15:43:57 +0900 (Wed, 28 Nov 2018) New Revision: 66071 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66071 Log: eliminate intermediate variable in very short block (3 times) Modified files: trunk/regparse.c Index: regparse.c =================================================================== --- regparse.c (revision 66070) +++ regparse.c (revision 66071) @@ -5994,10 +5994,7 @@ node_extended_grapheme_cluster(Node** np https://github.com/ruby/ruby/blob/trunk/regparse.c#L5994 seq[0] = node_new_cclass(); if (IS_NULL(seq[0])) goto err; cc = NCCLASS(seq[0]); - { - const OnigCodePoint *ranges = onigenc_unicode_GCB_ranges_GAZ; - R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges)); - } + R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, onigenc_unicode_GCB_ranges_GAZ)); R_ERR(add_property_to_cc(cc, "Grapheme_Cluster_Break=Glue_After_Zwj", 0, env)); R_ERR(quantify_property_node(seq+1, env, "Grapheme_Cluster_Break=Extend", '*')); @@ -6021,10 +6018,7 @@ node_extended_grapheme_cluster(Node** np https://github.com/ruby/ruby/blob/trunk/regparse.c#L6018 seq[0] = node_new_cclass(); if (IS_NULL(seq[0])) goto err; cc = NCCLASS(seq[0]); - { - const OnigCodePoint *ranges = onigenc_unicode_GCB_ranges_Emoji; - R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges)); - } + R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, onigenc_unicode_GCB_ranges_Emoji)); r = ONIGENC_CODE_TO_MBC(env->enc, 0xfe0f, buf); /* VARIATION SELECTOR-16 */ if (r < 0) goto err; @@ -6086,10 +6080,7 @@ node_extended_grapheme_cluster(Node** np https://github.com/ruby/ruby/blob/trunk/regparse.c#L6080 np1 = node_new_cclass(); if (IS_NULL(np1)) goto err; cc = NCCLASS(np1); - { - const OnigCodePoint *ranges = onigenc_unicode_GCB_ranges_E_Base; - R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, ranges)); - } + R_ERR(add_ctype_to_cc_by_range(cc, -1, 0, env, sb_out, onigenc_unicode_GCB_ranges_E_Base)); R_ERR(add_property_to_cc(cc, "Grapheme_Cluster_Break=E_Base", 0, env)); R_ERR(add_property_to_cc(cc, "Grapheme_Cluster_Break=E_Base_GAZ", 0, env)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/