Remove duplicate #include
PATCH 1/1 Remove duplicate #include
deheader (git://gitorious.org/deheader/deheader.git) found out that some .c files #include twice one and the same header file.
This patch removes such occurrences and hence speeds up the compilation.
--- builtin/fetch.c | 1 - trailer.c | 1 - transport-helper.c | 1 - userdiff.c | 1 - 4 files changed, 4 deletions(-)
builtin/fetch.c +0 -1
@@ -11,7 +11,6 @@#include "run-command.h" #include "parse-options.h" #include "sigchain.h" -#include "transport.h" #include "submodule.h" #include "connected.h" #include "argv-array.h"
trailer.c +0 -1
@@ -1,7 +1,6 @@#include "cache.h" #include "string-list.h" #include "run-command.h" -#include "string-list.h" #include "commit.h" #include "trailer.h" /*
transport-helper.c +0 -1
@@ -5,7 +5,6 @@#include "commit.h" #include "diff.h" #include "revision.h" -#include "quote.h" #include "remote.h" #include "string-list.h" #include "thread-utils.h"
userdiff.c +0 -1
@@ -1,6 +1,5 @@#include "cache.h" #include "userdiff.h" -#include "cache.h" #include "attr.h" static struct userdiff_driver *drivers;
Signature · 1 line
2.3.0.1.g24c2b87
Quoted 4 lines · Дилян Палаузов
deheader (
git://gitorious.org/deheader/deheader.git) found out that some .c files #include twice one and the same header file.This patch removes such occurrences and hence speeds up the compilation.
Does it speed up? By how much? Any numbers?
I do not see any reason to reject this change. Removing repeated inclusions of the same header is a good thing by itself [*1*].
Thanks.
[Footnote]
*1* If things break when repeated inclusions are removed, that would mean the headers were wrong in the first place. I do not think transport.h, string-list.h, quote.h and cache.h have any reason why they need to be included twice to work correctly, and in fact they are designed to be no-op when included twice.
Quoted 55 lines
Signed-off-by Дилян Палаузов <[email protected]>--- builtin/fetch.c | 1 - trailer.c | 1 - transport-helper.c | 1 - userdiff.c | 1 - 4 files changed, 4 deletions(-)builtin/fetch.c +0
-1@@ -11,7 +11,6 @@#include "run-command.h" #include "parse-options.h" #include "sigchain.h" -#include "transport.h" #include "submodule.h" #include "connected.h" #include "argv-array.h" trailer.c +0
-1@@ -1,7 +1,6 @@#include "cache.h" #include "string-list.h" #include "run-command.h" -#include "string-list.h" #include "commit.h" #include "trailer.h" /* transport-helper.c +0
-1@@ -5,7 +5,6 @@#include "commit.h" #include "diff.h" #include "revision.h" -#include "quote.h" #include "remote.h" #include "string-list.h" #include "thread-utils.h" userdiff.c +0
-1@@ -1,6 +1,5 @@#include "cache.h" #include "userdiff.h" -#include "cache.h" #include "attr.h" static struct userdiff_driver *drivers;
Hello Junio,
in theory it speeds up, because the preprocessor has less work to do. In practice I don't know how much and this seems also irrelevant criterion for accepting this patch.
Greetings
Dilyan
Quoted 77 lines · Junio C Hamano
Quoted 4 lines · Дилян Палаузов
deheader (
git://gitorious.org/deheader/deheader.git) found out that some .c files #include twice one and the same header file.This patch removes such occurrences and hence speeds up the compilation.
Does it speed up? By how much? Any numbers?
I do not see any reason to reject this change. Removing repeated inclusions of the same header is a good thing by itself [*1*].
Thanks.
[Footnote]
*1* If things break when repeated inclusions are removed, that would mean the headers were wrong in the first place. I do not think
transport.h,string-list.h,quote.handcache.hhave any reason why they need to be included twice to work correctly, and in fact they are designed to be no-op when included twice.Quoted 55 lines
Signed-off-by Дилян Палаузов <[email protected]>--- builtin/fetch.c | 1 - trailer.c | 1 - transport-helper.c | 1 - userdiff.c | 1 - 4 files changed, 4 deletions(-)builtin/fetch.c +0
-1@@ -11,7 +11,6 @@#include "run-command.h" #include "parse-options.h" #include "sigchain.h" -#include "transport.h" #include "submodule.h" #include "connected.h" #include "argv-array.h" trailer.c +0
-1@@ -1,7 +1,6 @@#include "cache.h" #include "string-list.h" #include "run-command.h" -#include "string-list.h" #include "commit.h" #include "trailer.h" /* transport-helper.c +0
-1@@ -5,7 +5,6 @@#include "commit.h" #include "diff.h" #include "revision.h" -#include "quote.h" #include "remote.h" #include "string-list.h" #include "thread-utils.h" userdiff.c +0
-1@@ -1,6 +1,5 @@#include "cache.h" #include "userdiff.h" -#include "cache.h" #include "attr.h" static struct userdiff_driver *drivers;