Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f14f75d4
Commit
f14f75d4
authored
Feb 02, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
khash: avoid using `kh_resize` directly
parent
73028af8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
src/idxmap.h
+1
-0
src/index.c
+6
-6
No files found.
src/idxmap.h
View file @
f14f75d4
...
...
@@ -71,6 +71,7 @@ static kh_inline khint_t idxentry_hash(const git_index_entry *e)
#define git_idxmap_has_data(h, idx) kh_exist(h, idx)
#define git_idxmap_resize(h,s) kh_resize(idx, h, s)
#define git_idxmap_icase_resize(h,s) kh_resize(idxicase, h, s)
#define git_idxmap_free(h) kh_destroy(idx, h), h = NULL
#define git_idxmap_clear(h) kh_clear(idx, h)
...
...
src/index.c
View file @
f14f75d4
...
...
@@ -2479,9 +2479,9 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
assert
(
!
index
->
entries
.
length
);
if
(
index
->
ignore_case
)
kh_resize
(
idxicase
,
(
khash_t
(
idxicase
)
*
)
index
->
entries_map
,
header
.
entry_count
);
git_idxmap_icase_resize
(
(
khash_t
(
idxicase
)
*
)
index
->
entries_map
,
header
.
entry_count
);
else
kh_resize
(
idx
,
index
->
entries_map
,
header
.
entry_count
);
git_idxmap_resize
(
index
->
entries_map
,
header
.
entry_count
);
/* Parse all the entries */
for
(
i
=
0
;
i
<
header
.
entry_count
&&
buffer_size
>
INDEX_FOOTER_SIZE
;
++
i
)
{
...
...
@@ -2979,9 +2979,9 @@ int git_index_read_tree(git_index *index, const git_tree *tree)
goto
cleanup
;
if
(
index
->
ignore_case
)
kh_resize
(
idxicase
,
(
khash_t
(
idxicase
)
*
)
entries_map
,
entries
.
length
);
git_idxmap_icase_resize
(
(
khash_t
(
idxicase
)
*
)
entries_map
,
entries
.
length
);
else
kh_resize
(
idx
,
entries_map
,
entries
.
length
);
git_idxmap_resize
(
entries_map
,
entries
.
length
);
git_vector_foreach
(
&
entries
,
i
,
e
)
{
INSERT_IN_MAP_EX
(
index
,
entries_map
,
e
,
&
error
);
...
...
@@ -3037,9 +3037,9 @@ static int git_index_read_iterator(
goto
done
;
if
(
index
->
ignore_case
&&
new_length_hint
)
kh_resize
(
idxicase
,
(
khash_t
(
idxicase
)
*
)
new_entries_map
,
new_length_hint
);
git_idxmap_icase_resize
(
(
khash_t
(
idxicase
)
*
)
new_entries_map
,
new_length_hint
);
else
if
(
new_length_hint
)
kh_resize
(
idx
,
new_entries_map
,
new_length_hint
);
git_idxmap_resize
(
new_entries_map
,
new_length_hint
);
opts
.
flags
=
GIT_ITERATOR_DONT_IGNORE_CASE
|
GIT_ITERATOR_INCLUDE_CONFLICTS
;
...
...
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