ruby-changes:5537
From: nobu <ko1@a...>
Date: Mon, 9 Jun 2008 14:40:04 +0900 (JST)
Subject: [ruby-changes:5537] Ruby:r17040 (trunk): * rational.c (make_patterns): constified.
nobu 2008-06-09 14:39:57 +0900 (Mon, 09 Jun 2008) New Revision: 17040 Modified files: trunk/rational.c Log: * rational.c (make_patterns): constified. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/rational.c?r1=17040&r2=17039&diff_format=u Index: rational.c =================================================================== --- rational.c (revision 17039) +++ rational.c (revision 17040) @@ -1287,11 +1287,13 @@ static void make_patterns(void) { - static char rat_pat_source[] = PATTERN; - static char an_e_pat_source[] = "[eE]"; - static char a_dot_pat_source[] = "\\."; - static char underscores_pat_source[] = "_+"; + static char const rat_pat_source[] = PATTERN; + static char const an_e_pat_source[] = "[eE]"; + static char const a_dot_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); rb_global_variable(&rat_pat); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/