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
5c15aa2f
Commit
5c15aa2f
authored
Apr 17, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make `ary_concat()` to replace the receiver when it is empty.
parent
c078783a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/array.c
src/array.c
+6
-0
No files found.
src/array.c
View file @
5c15aa2f
...
...
@@ -285,11 +285,17 @@ mrb_ary_s_create(mrb_state *mrb, mrb_value klass)
return
ary
;
}
static
void
ary_replace
(
mrb_state
*
,
struct
RArray
*
,
struct
RArray
*
);
static
void
ary_concat
(
mrb_state
*
mrb
,
struct
RArray
*
a
,
struct
RArray
*
a2
)
{
mrb_int
len
;
if
(
ARY_LEN
(
a
)
==
0
)
{
ary_replace
(
mrb
,
a
,
a2
);
return
;
}
if
(
ARY_LEN
(
a2
)
>
ARY_MAX_SIZE
-
ARY_LEN
(
a
))
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"array size too big"
);
}
...
...
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