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
8f1ff26b
Commit
8f1ff26b
authored
Feb 02, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idxmap: remove GIT__USE_IDXMAP
parent
cee9ca66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
23 deletions
+14
-23
src/idxmap.c
+14
-2
src/idxmap.h
+0
-18
src/index.c
+0
-3
No files found.
src/idxmap.c
View file @
8f1ff26b
...
@@ -7,8 +7,20 @@
...
@@ -7,8 +7,20 @@
#include "idxmap.h"
#include "idxmap.h"
GIT__USE_IDXMAP
/* This is __ac_X31_hash_string but with tolower and it takes the entry's stage into account */
GIT__USE_IDXMAP_ICASE
static
kh_inline
khint_t
idxentry_hash
(
const
git_index_entry
*
e
)
{
const
char
*
s
=
e
->
path
;
khint_t
h
=
(
khint_t
)
git__tolower
(
*
s
);
if
(
h
)
for
(
++
s
;
*
s
;
++
s
)
h
=
(
h
<<
5
)
-
h
+
(
khint_t
)
git__tolower
(
*
s
);
return
h
+
GIT_IDXENTRY_STAGE
(
e
);
}
#define idxentry_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
#define idxentry_icase_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
__KHASH_IMPL
(
idx
,
static
kh_inline
,
const
git_index_entry
*
,
git_index_entry
*
,
1
,
idxentry_hash
,
idxentry_equal
)
__KHASH_IMPL
(
idxicase
,
static
kh_inline
,
const
git_index_entry
*
,
git_index_entry
*
,
1
,
idxentry_hash
,
idxentry_icase_equal
)
int
git_idxmap_alloc
(
git_idxmap
**
map
)
int
git_idxmap_alloc
(
git_idxmap
**
map
)
{
{
...
...
src/idxmap.h
View file @
8f1ff26b
...
@@ -26,24 +26,6 @@ typedef khash_t(idxicase) git_idxmap_icase;
...
@@ -26,24 +26,6 @@ typedef khash_t(idxicase) git_idxmap_icase;
typedef
khiter_t
git_idxmap_iter
;
typedef
khiter_t
git_idxmap_iter
;
/* This is __ac_X31_hash_string but with tolower and it takes the entry's stage into account */
static
kh_inline
khint_t
idxentry_hash
(
const
git_index_entry
*
e
)
{
const
char
*
s
=
e
->
path
;
khint_t
h
=
(
khint_t
)
git__tolower
(
*
s
);
if
(
h
)
for
(
++
s
;
*
s
;
++
s
)
h
=
(
h
<<
5
)
-
h
+
(
khint_t
)
git__tolower
(
*
s
);
return
h
+
GIT_IDXENTRY_STAGE
(
e
);
}
#define idxentry_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
#define idxentry_icase_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
#define GIT__USE_IDXMAP \
__KHASH_IMPL(idx, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_equal)
#define GIT__USE_IDXMAP_ICASE \
__KHASH_IMPL(idxicase, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_icase_equal)
int
git_idxmap_alloc
(
git_idxmap
**
map
);
int
git_idxmap_alloc
(
git_idxmap
**
map
);
int
git_idxmap_icase_alloc
(
git_idxmap_icase
**
map
);
int
git_idxmap_icase_alloc
(
git_idxmap_icase
**
map
);
void
git_idxmap_insert
(
git_idxmap
*
map
,
const
git_index_entry
*
key
,
void
*
value
,
int
*
rval
);
void
git_idxmap_insert
(
git_idxmap
*
map
,
const
git_index_entry
*
key
,
void
*
value
,
int
*
rval
);
...
...
src/index.c
View file @
8f1ff26b
...
@@ -27,9 +27,6 @@
...
@@ -27,9 +27,6 @@
#include "git2/config.h"
#include "git2/config.h"
#include "git2/sys/index.h"
#include "git2/sys/index.h"
GIT__USE_IDXMAP
GIT__USE_IDXMAP_ICASE
#define INSERT_IN_MAP_EX(idx, map, e, err) do { \
#define INSERT_IN_MAP_EX(idx, map, e, err) do { \
if ((idx)->ignore_case) \
if ((idx)->ignore_case) \
git_idxmap_icase_insert((khash_t(idxicase) *) (map), (e), (e), (err)); \
git_idxmap_icase_insert((khash_t(idxicase) *) (map), (e), (e), (err)); \
...
...
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