diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-14 12:20:18 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-14 12:20:18 +0900 |
| commit | 636addd645a430c3b014ca99b11c1ee82b078a8b (patch) | |
| tree | baf6c159577f873107fe421b57dfa122ca2dfd76 /src/variable.c | |
| parent | 65678f11b427e11c33ffef5ba7adabd87bd4f530 (diff) | |
| parent | 649081661a8f7a952b9386a63fe7271f3432f627 (diff) | |
| download | mruby-636addd645a430c3b014ca99b11c1ee82b078a8b.tar.gz mruby-636addd645a430c3b014ca99b11c1ee82b078a8b.zip | |
Merge pull request #2059 from cremno/reduce-rstring_ptr-usage
reduce RSTRING_PTR usage
Diffstat (limited to 'src/variable.c')
| -rw-r--r-- | src/variable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/variable.c b/src/variable.c index 3dcdbf775..90f0831da 100644 --- a/src/variable.c +++ b/src/variable.c @@ -563,10 +563,11 @@ inspect_i(mrb_state *mrb, mrb_sym sym, mrb_value v, void *p) const char *s; mrb_int len; mrb_value ins; + char *sp = RSTRING_PTR(str); /* need not to show internal data */ - if (RSTRING_PTR(str)[0] == '-') { /* first element */ - RSTRING_PTR(str)[0] = '#'; + if (sp[0] == '-') { /* first element */ + sp[0] = '#'; mrb_str_cat_lit(mrb, str, " "); } else { |
