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
db437b04
Commit
db437b04
authored
Aug 22, 2017
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`mrb_obj_respond_to` to use `mrb_method_search_vm`.
parent
0d865a77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
17 deletions
+5
-17
src/class.c
src/class.c
+5
-17
No files found.
src/class.c
View file @
db437b04
...
...
@@ -1563,25 +1563,13 @@ mrb_obj_not_equal_m(mrb_state *mrb, mrb_value self)
MRB_API
mrb_bool
mrb_obj_respond_to
(
mrb_state
*
mrb
,
struct
RClass
*
c
,
mrb_sym
mid
)
{
khiter_t
k
;
while
(
c
)
{
khash_t
(
mt
)
*
h
=
c
->
mt
;
struct
RProc
*
m
;
if
(
h
)
{
k
=
kh_get
(
mt
,
mrb
,
h
,
mid
);
if
(
k
!=
kh_end
(
h
))
{
if
(
kh_value
(
h
,
k
))
{
return
TRUE
;
/* method exists */
}
else
{
return
FALSE
;
/* undefined method */
}
}
}
c
=
c
->
super
;
m
=
mrb_method_search_vm
(
mrb
,
&
c
,
mid
);
if
(
!
m
)
{
return
FALSE
;
}
return
FALSE
;
/* no method */
return
TRUE
;
}
MRB_API
mrb_bool
...
...
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