diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2023-03-19 19:27:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-20 21:55:18 +0300 |
commit | c4d9c79378e9108358c3f20e27bc437754cd805d (patch) | |
tree | e84e1521b69688e904a31feb8edb805730bf4d44 /ref-filter.h | |
parent | 49fd5511945977882ef2cd8b3c00ed25ac208512 (diff) |
treewide: remove unnecessary inclusions of parse-options.h from headers
The headers 'diagnose.h', 'list-objects-filter-options.h',
'ref-filter.h' and 'remote.h' declare option parsing callback
functions with a 'struct option*' parameter, and 'revision.h' declares
an option parsing helper function taking 'struct parse_opt_ctx_t*' and
'struct option*' parameters. These headers all include
'parse-options.h', although they don't need any of the type
definitions from that header file. Furthermore,
'list-objects-filter-options.h' and 'ref-filter.h' also define some
OPT_* macros to initialize a 'struct option', but these don't
necessitate the inclusion of parse-options.h in these headers either,
because these macros are only expanded in source files.
Remove these unnecessary inclusions of parse-options.h and use forward
declarations to declare the necessary types.
After this patch none of the header files include parse-options.h
anymore.
With these changes, the build time after modifying only
parse-options.h is reduced by about 30%, and the number of targets
built is almost 20% less:
Before:
$ touch parse-options.h && time make -j4 |wc -l
353
real 1m1.527s
user 3m32.205s
sys 0m15.903s
After:
289
real 0m39.285s
user 2m12.540s
sys 0m11.164s
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.h')
-rw-r--r-- | ref-filter.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ref-filter.h b/ref-filter.h index aa0eea4ecf..daa6d02017 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -4,7 +4,6 @@ #include "oid-array.h" #include "refs.h" #include "commit.h" -#include "parse-options.h" /* Quoting styles */ #define QUOTE_NONE 0 @@ -24,6 +23,7 @@ struct atom_value; struct ref_sorting; +struct option; enum ref_sorting_order { REF_SORTING_REVERSE = 1<<0, |