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
13587257
Commit
13587257
authored
Aug 07, 2017
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Aug 07, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3764 from christopheraue/new_hash_perf
Improved speed of creating new hash tables
parents
1b9c4855
ec7475d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
src/hash.c
src/hash.c
+2
-4
No files found.
src/hash.c
View file @
13587257
...
...
@@ -145,10 +145,8 @@ mrb_hash_new_capa(mrb_state *mrb, mrb_int capa)
struct
RHash
*
h
;
h
=
(
struct
RHash
*
)
mrb_obj_alloc
(
mrb
,
MRB_TT_HASH
,
mrb
->
hash_class
);
h
->
ht
=
kh_init
(
ht
,
mrb
);
if
(
capa
>
0
)
{
kh_resize
(
ht
,
mrb
,
h
->
ht
,
capa
);
}
/* khash needs 1/4 empty space so it is not resized immediately */
h
->
ht
=
kh_init_size
(
ht
,
mrb
,
capa
*
4
/
3
);
h
->
iv
=
0
;
return
mrb_obj_value
(
h
);
}
...
...
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