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
ef0fc90c
Commit
ef0fc90c
authored
Jun 02, 2015
by
cremno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary mrb_immediate_p()
`!mrb_array_p(ary2)` and `mrb_type(obj) != MRB_TT_DATA` are sufficient.
parent
2f635f56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
src/array.c
src/array.c
+0
-2
src/etc.c
src/etc.c
+2
-2
No files found.
src/array.c
View file @
ef0fc90c
...
...
@@ -1052,7 +1052,6 @@ mrb_ary_eq(mrb_state *mrb, mrb_value ary1)
mrb_get_args
(
mrb
,
"o"
,
&
ary2
);
if
(
mrb_obj_equal
(
mrb
,
ary1
,
ary2
))
return
mrb_true_value
();
if
(
mrb_immediate_p
(
ary2
))
return
mrb_false_value
();
if
(
!
mrb_array_p
(
ary2
))
{
return
mrb_false_value
();
}
...
...
@@ -1068,7 +1067,6 @@ mrb_ary_cmp(mrb_state *mrb, mrb_value ary1)
mrb_get_args
(
mrb
,
"o"
,
&
ary2
);
if
(
mrb_obj_equal
(
mrb
,
ary1
,
ary2
))
return
mrb_fixnum_value
(
0
);
if
(
mrb_immediate_p
(
ary2
))
return
mrb_nil_value
();
if
(
!
mrb_array_p
(
ary2
))
{
return
mrb_nil_value
();
}
...
...
src/etc.c
View file @
ef0fc90c
...
...
@@ -26,7 +26,7 @@ mrb_data_object_alloc(mrb_state *mrb, struct RClass *klass, void *ptr, const mrb
MRB_API
void
mrb_data_check_type
(
mrb_state
*
mrb
,
mrb_value
obj
,
const
mrb_data_type
*
type
)
{
if
(
mrb_
immediate_p
(
obj
)
||
(
mrb_type
(
obj
)
!=
MRB_TT_DATA
)
)
{
if
(
mrb_
type
(
obj
)
!=
MRB_TT_DATA
)
{
mrb_check_type
(
mrb
,
obj
,
MRB_TT_DATA
);
}
if
(
DATA_TYPE
(
obj
)
!=
type
)
{
...
...
@@ -48,7 +48,7 @@ mrb_data_check_type(mrb_state *mrb, mrb_value obj, const mrb_data_type *type)
MRB_API
void
*
mrb_data_check_get_ptr
(
mrb_state
*
mrb
,
mrb_value
obj
,
const
mrb_data_type
*
type
)
{
if
(
mrb_
immediate_p
(
obj
)
||
(
mrb_type
(
obj
)
!=
MRB_TT_DATA
)
)
{
if
(
mrb_
type
(
obj
)
!=
MRB_TT_DATA
)
{
return
NULL
;
}
if
(
DATA_TYPE
(
obj
)
!=
type
)
{
...
...
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