diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-09 05:39:57 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-09 05:39:57 +0000 |
| commit | 374fff4dd303378e487d02e591b5e257d8631625 (patch) | |
| tree | f31777391e31e7e60b4f9178a5c8e7d84da3ca72 | |
| parent | 10ff0fcb52d116d1e4b0ff3c35821454c6622f19 (diff) | |
| download | ruby-374fff4dd303378e487d02e591b5e257d8631625.tar.gz ruby-374fff4dd303378e487d02e591b5e257d8631625.tar.xz ruby-374fff4dd303378e487d02e591b5e257d8631625.zip | |
* rational.c (make_patterns): constified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | rational.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/rational.c b/rational.c index 13487363f..dc29aa162 100644 --- a/rational.c +++ b/rational.c @@ -1287,10 +1287,12 @@ static VALUE rat_pat, an_e_pat, a_dot_pat, underscores_pat, an_underscore; 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); |
