Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
7047c52d
Commit
7047c52d
authored
5 years ago
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `mrb_str_cat_str` instead of `mrb_str_concat` if possible
parent
fddefeb7
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
mrbgems/mruby-string-ext/src/string.c
mrbgems/mruby-string-ext/src/string.c
+2
-2
src/class.c
src/class.c
+1
-1
src/object.c
src/object.c
+1
-1
src/variable.c
src/variable.c
+1
-1
No files found.
mrbgems/mruby-string-ext/src/string.c
View file @
7047c52d
...
@@ -174,8 +174,8 @@ mrb_str_concat_m(mrb_state *mrb, mrb_value self)
...
@@ -174,8 +174,8 @@ mrb_str_concat_m(mrb_state *mrb, mrb_value self)
str
=
int_chr_binary
(
mrb
,
str
);
str
=
int_chr_binary
(
mrb
,
str
);
#endif
#endif
else
else
str
=
mrb_ensure_string_type
(
mrb
,
str
);
mrb_ensure_string_type
(
mrb
,
str
);
mrb_str_c
oncat
(
mrb
,
self
,
str
);
mrb_str_c
at_str
(
mrb
,
self
,
str
);
return
self
;
return
self
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/class.c
View file @
7047c52d
...
@@ -145,7 +145,7 @@ class_name_str(mrb_state *mrb, struct RClass* c)
...
@@ -145,7 +145,7 @@ class_name_str(mrb_state *mrb, struct RClass* c)
if
(
mrb_nil_p
(
path
))
{
if
(
mrb_nil_p
(
path
))
{
path
=
c
->
tt
==
MRB_TT_MODULE
?
mrb_str_new_lit
(
mrb
,
"#<Module:"
)
:
path
=
c
->
tt
==
MRB_TT_MODULE
?
mrb_str_new_lit
(
mrb
,
"#<Module:"
)
:
mrb_str_new_lit
(
mrb
,
"#<Class:"
);
mrb_str_new_lit
(
mrb
,
"#<Class:"
);
mrb_str_c
oncat
(
mrb
,
path
,
mrb_ptr_to_str
(
mrb
,
c
));
mrb_str_c
at_str
(
mrb
,
path
,
mrb_ptr_to_str
(
mrb
,
c
));
mrb_str_cat_lit
(
mrb
,
path
,
">"
);
mrb_str_cat_lit
(
mrb
,
path
,
">"
);
}
}
return
path
;
return
path
;
...
...
This diff is collapsed.
Click to expand it.
src/object.c
View file @
7047c52d
...
@@ -423,7 +423,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
...
@@ -423,7 +423,7 @@ mrb_any_to_s(mrb_state *mrb, mrb_value obj)
mrb_str_cat_cstr
(
mrb
,
str
,
cname
);
mrb_str_cat_cstr
(
mrb
,
str
,
cname
);
if
(
!
mrb_immediate_p
(
obj
))
{
if
(
!
mrb_immediate_p
(
obj
))
{
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_c
oncat
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
mrb_ptr
(
obj
)));
mrb_str_c
at_str
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
mrb_ptr
(
obj
)));
}
}
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
...
...
This diff is collapsed.
Click to expand it.
src/variable.c
View file @
7047c52d
...
@@ -509,7 +509,7 @@ mrb_obj_iv_inspect(mrb_state *mrb, struct RObject *obj)
...
@@ -509,7 +509,7 @@ mrb_obj_iv_inspect(mrb_state *mrb, struct RObject *obj)
mrb_str_cat_lit
(
mrb
,
str
,
"-<"
);
mrb_str_cat_lit
(
mrb
,
str
,
"-<"
);
mrb_str_cat_cstr
(
mrb
,
str
,
cn
);
mrb_str_cat_cstr
(
mrb
,
str
,
cn
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_cat_lit
(
mrb
,
str
,
":"
);
mrb_str_c
oncat
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
obj
));
mrb_str_c
at_str
(
mrb
,
str
,
mrb_ptr_to_str
(
mrb
,
obj
));
iv_foreach
(
mrb
,
t
,
inspect_i
,
&
str
);
iv_foreach
(
mrb
,
t
,
inspect_i
,
&
str
);
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
mrb_str_cat_lit
(
mrb
,
str
,
">"
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment