diff options
| author | cremno <[email protected]> | 2014-04-14 00:58:34 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2014-04-14 00:58:34 +0200 |
| commit | 649081661a8f7a952b9386a63fe7271f3432f627 (patch) | |
| tree | baf6c159577f873107fe421b57dfa122ca2dfd76 /src/variable.c | |
| parent | 65678f11b427e11c33ffef5ba7adabd87bd4f530 (diff) | |
| download | mruby-649081661a8f7a952b9386a63fe7271f3432f627.tar.gz mruby-649081661a8f7a952b9386a63fe7271f3432f627.zip | |
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 { |
