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
684f8ec5
Commit
684f8ec5
authored
Jun 28, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2430 from SHyx0rmZ/remove-duplicate
Sacrifice some micro-optimization to remove duplicate code
parents
344b7d81
73c086b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
25 deletions
+10
-25
src/vm.c
src/vm.c
+10
-25
No files found.
src/vm.c
View file @
684f8ec5
...
...
@@ -309,36 +309,21 @@ ecall(mrb_state *mrb, int i)
mrb_value
mrb_funcall
(
mrb_state
*
mrb
,
mrb_value
self
,
const
char
*
name
,
mrb_int
argc
,
...)
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
mrb_int
i
;
mrb_sym
mid
=
mrb_intern_cstr
(
mrb
,
name
);
if
(
argc
==
0
)
{
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
0
,
0
);
if
(
argc
>
MRB_FUNCALL_ARGC_MAX
)
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"Too long arguments. (limit="
TO_STR
(
MRB_FUNCALL_ARGC_MAX
)
")"
);
}
else
if
(
argc
==
1
)
{
mrb_value
v
;
va_list
ap
;
va_start
(
ap
,
argc
);
v
=
va_arg
(
ap
,
mrb_value
);
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
1
,
&
v
);
}
else
{
mrb_value
argv
[
MRB_FUNCALL_ARGC_MAX
];
va_list
ap
;
mrb_int
i
;
if
(
argc
>
MRB_FUNCALL_ARGC_MAX
)
{
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"Too long arguments. (limit="
TO_STR
(
MRB_FUNCALL_ARGC_MAX
)
")"
);
}
va_start
(
ap
,
argc
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
argv
[
i
]
=
va_arg
(
ap
,
mrb_value
);
}
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
argc
,
argv
);
va_start
(
ap
,
argc
);
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
argv
[
i
]
=
va_arg
(
ap
,
mrb_value
);
}
va_end
(
ap
);
return
mrb_funcall_argv
(
mrb
,
self
,
mid
,
argc
,
argv
);
}
mrb_value
...
...
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