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
a0dd4668
Unverified
Commit
a0dd4668
authored
Nov 01, 2021
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
object.c: fast implementation of `mrb_obj_eq`.
For `MRB_NAN_BOXING` and `MRB_WORD_BOXING`.
parent
d8204d51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/object.c
src/object.c
+7
-0
No files found.
src/object.c
View file @
a0dd4668
...
...
@@ -14,12 +14,18 @@
MRB_API
mrb_bool
mrb_obj_eq
(
mrb_state
*
mrb
,
mrb_value
v1
,
mrb_value
v2
)
{
#if defined(MRB_NAN_BOXING)
return
v1
.
u
==
v2
.
u
;
#elif defined(MRB_NAN_BOXING)
return
v1
.
w
==
v2
.
w
;
#else
/* MRB_NO_BOXING */
if
(
mrb_type
(
v1
)
!=
mrb_type
(
v2
))
return
FALSE
;
switch
(
mrb_type
(
v1
))
{
case
MRB_TT_TRUE
:
return
TRUE
;
case
MRB_TT_FALSE
:
return
(
mrb_fixnum
(
v1
)
==
mrb_fixnum
(
v2
));
case
MRB_TT_INTEGER
:
return
(
mrb_integer
(
v1
)
==
mrb_integer
(
v2
));
case
MRB_TT_SYMBOL
:
...
...
@@ -33,6 +39,7 @@ mrb_obj_eq(mrb_state *mrb, mrb_value v1, mrb_value v2)
default:
return
(
mrb_ptr
(
v1
)
==
mrb_ptr
(
v2
));
}
#endif
}
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