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
59b35250
Unverified
Commit
59b35250
authored
Jul 22, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `mrb_hash_modify` to `hash_modify`.
Since it's an internal static function.
parent
2b45d454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/hash.c
src/hash.c
+10
-10
No files found.
src/hash.c
View file @
59b35250
...
@@ -589,7 +589,7 @@ ht_free(mrb_state *mrb, htable *t)
...
@@ -589,7 +589,7 @@ ht_free(mrb_state *mrb, htable *t)
mrb_free
(
mrb
,
t
);
mrb_free
(
mrb
,
t
);
}
}
static
void
mrb_
hash_modify
(
mrb_state
*
mrb
,
mrb_value
hash
);
static
void
hash_modify
(
mrb_state
*
mrb
,
mrb_value
hash
);
static
inline
mrb_value
static
inline
mrb_value
ht_key
(
mrb_state
*
mrb
,
mrb_value
key
)
ht_key
(
mrb_state
*
mrb
,
mrb_value
key
)
...
@@ -752,7 +752,7 @@ mrb_hash_fetch(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value def)
...
@@ -752,7 +752,7 @@ mrb_hash_fetch(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value def)
MRB_API
void
MRB_API
void
mrb_hash_set
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
,
mrb_value
val
)
mrb_hash_set
(
mrb_state
*
mrb
,
mrb_value
hash
,
mrb_value
key
,
mrb_value
val
)
{
{
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
key
=
KEY
(
key
);
key
=
KEY
(
key
);
ht_put
(
mrb
,
RHASH_TBL
(
hash
),
key
,
val
);
ht_put
(
mrb
,
RHASH_TBL
(
hash
),
key
,
val
);
...
@@ -762,7 +762,7 @@ mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val)
...
@@ -762,7 +762,7 @@ mrb_hash_set(mrb_state *mrb, mrb_value hash, mrb_value key, mrb_value val)
}
}
static
void
static
void
mrb_
hash_modify
(
mrb_state
*
mrb
,
mrb_value
hash
)
hash_modify
(
mrb_state
*
mrb
,
mrb_value
hash
)
{
{
mrb_check_frozen
(
mrb
,
mrb_hash_ptr
(
hash
));
mrb_check_frozen
(
mrb
,
mrb_hash_ptr
(
hash
));
if
(
!
RHASH_TBL
(
hash
))
{
if
(
!
RHASH_TBL
(
hash
))
{
...
@@ -814,7 +814,7 @@ mrb_hash_init(mrb_state *mrb, mrb_value hash)
...
@@ -814,7 +814,7 @@ mrb_hash_init(mrb_state *mrb, mrb_value hash)
ifnone
=
mrb_nil_value
();
ifnone
=
mrb_nil_value
();
mrb_get_args
(
mrb
,
"&|o?"
,
&
block
,
&
ifnone
,
&
ifnone_p
);
mrb_get_args
(
mrb
,
"&|o?"
,
&
block
,
&
ifnone
,
&
ifnone_p
);
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
if
(
!
mrb_nil_p
(
block
))
{
if
(
!
mrb_nil_p
(
block
))
{
if
(
ifnone_p
)
{
if
(
ifnone_p
)
{
mrb_argnum_error
(
mrb
,
1
,
0
,
0
);
mrb_argnum_error
(
mrb
,
1
,
0
,
0
);
...
@@ -932,7 +932,7 @@ mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
...
@@ -932,7 +932,7 @@ mrb_hash_set_default(mrb_state *mrb, mrb_value hash)
{
{
mrb_value
ifnone
=
mrb_get_arg1
(
mrb
);
mrb_value
ifnone
=
mrb_get_arg1
(
mrb
);
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
mrb_iv_set
(
mrb
,
hash
,
MRB_SYM
(
ifnone
),
ifnone
);
mrb_iv_set
(
mrb
,
hash
,
MRB_SYM
(
ifnone
),
ifnone
);
RHASH
(
hash
)
->
flags
&=
~
MRB_HASH_PROC_DEFAULT
;
RHASH
(
hash
)
->
flags
&=
~
MRB_HASH_PROC_DEFAULT
;
if
(
!
mrb_nil_p
(
ifnone
))
{
if
(
!
mrb_nil_p
(
ifnone
))
{
...
@@ -987,7 +987,7 @@ mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
...
@@ -987,7 +987,7 @@ mrb_hash_set_default_proc(mrb_state *mrb, mrb_value hash)
{
{
mrb_value
ifnone
=
mrb_get_arg1
(
mrb
);
mrb_value
ifnone
=
mrb_get_arg1
(
mrb
);
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
mrb_iv_set
(
mrb
,
hash
,
MRB_SYM
(
ifnone
),
ifnone
);
mrb_iv_set
(
mrb
,
hash
,
MRB_SYM
(
ifnone
),
ifnone
);
if
(
!
mrb_nil_p
(
ifnone
))
{
if
(
!
mrb_nil_p
(
ifnone
))
{
RHASH
(
hash
)
->
flags
|=
MRB_HASH_PROC_DEFAULT
;
RHASH
(
hash
)
->
flags
|=
MRB_HASH_PROC_DEFAULT
;
...
@@ -1020,7 +1020,7 @@ mrb_hash_delete(mrb_state *mrb, mrb_value self)
...
@@ -1020,7 +1020,7 @@ mrb_hash_delete(mrb_state *mrb, mrb_value self)
{
{
mrb_value
key
=
mrb_get_arg1
(
mrb
);
mrb_value
key
=
mrb_get_arg1
(
mrb
);
mrb_
hash_modify
(
mrb
,
self
);
hash_modify
(
mrb
,
self
);
return
mrb_hash_delete_key
(
mrb
,
self
,
key
);
return
mrb_hash_delete_key
(
mrb
,
self
,
key
);
}
}
...
@@ -1070,7 +1070,7 @@ mrb_hash_shift(mrb_state *mrb, mrb_value hash)
...
@@ -1070,7 +1070,7 @@ mrb_hash_shift(mrb_state *mrb, mrb_value hash)
{
{
htable
*
t
=
RHASH_TBL
(
hash
);
htable
*
t
=
RHASH_TBL
(
hash
);
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
if
(
t
&&
t
->
size
>
0
)
{
if
(
t
&&
t
->
size
>
0
)
{
mrb_value
del_key
=
mrb_nil_value
();
mrb_value
del_key
=
mrb_nil_value
();
mrb_value
del_val
=
mrb_nil_value
();
mrb_value
del_val
=
mrb_nil_value
();
...
@@ -1109,7 +1109,7 @@ mrb_hash_clear(mrb_state *mrb, mrb_value hash)
...
@@ -1109,7 +1109,7 @@ mrb_hash_clear(mrb_state *mrb, mrb_value hash)
{
{
htable
*
t
=
RHASH_TBL
(
hash
);
htable
*
t
=
RHASH_TBL
(
hash
);
mrb_
hash_modify
(
mrb
,
hash
);
hash_modify
(
mrb
,
hash
);
if
(
t
)
{
if
(
t
)
{
ht_free
(
mrb
,
t
);
ht_free
(
mrb
,
t
);
RHASH_TBL
(
hash
)
=
NULL
;
RHASH_TBL
(
hash
)
=
NULL
;
...
@@ -1368,7 +1368,7 @@ mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2)
...
@@ -1368,7 +1368,7 @@ mrb_hash_merge(mrb_state *mrb, mrb_value hash1, mrb_value hash2)
{
{
htable
*
h1
,
*
h2
;
htable
*
h1
,
*
h2
;
mrb_
hash_modify
(
mrb
,
hash1
);
hash_modify
(
mrb
,
hash1
);
hash2
=
mrb_ensure_hash_type
(
mrb
,
hash2
);
hash2
=
mrb_ensure_hash_type
(
mrb
,
hash2
);
h1
=
RHASH_TBL
(
hash1
);
h1
=
RHASH_TBL
(
hash1
);
h2
=
RHASH_TBL
(
hash2
);
h2
=
RHASH_TBL
(
hash2
);
...
...
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