mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* rational.c (make_patterns): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6cdc89332e
commit
85976cf893
1 changed files with 6 additions and 4 deletions
10
rational.c
10
rational.c
|
@ -1287,10 +1287,12 @@ static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore;
|
||||||
static void
|
static void
|
||||||
make_patterns(void)
|
make_patterns(void)
|
||||||
{
|
{
|
||||||
static char rat_pat_source[] = PATTERN;
|
static char const rat_pat_source[] = PATTERN;
|
||||||
static char an_e_pat_source[] = "[eE]";
|
static char const an_e_pat_source[] = "[eE]";
|
||||||
static char a_dot_pat_source[] = "\\.";
|
static char const a_dot_pat_source[] = "\\.";
|
||||||
static char underscores_pat_source[] = "_+";
|
static char const underscores_pat_source[] = "_+";
|
||||||
|
|
||||||
|
if (rat_pat) return;
|
||||||
|
|
||||||
rat_pat = rb_reg_new(rat_pat_source, sizeof rat_pat_source - 1, 0);
|
rat_pat = rb_reg_new(rat_pat_source, sizeof rat_pat_source - 1, 0);
|
||||||
rb_global_variable(&rat_pat);
|
rb_global_variable(&rat_pat);
|
||||||
|
|
Loading…
Add table
Reference in a new issue