preload-index.c: remove #ifdef NO_PTHREADS

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Nov 3, 2018 at 09:48 UTC e8d405662fa2e89b850ec79573953e17fea83ed1
1 file changed +2 -13
preload-index.c
+2 -13
@@ -7,17 +7,7 @@
7 #include "fsmonitor.h"
8 #include "config.h"
9 #include "progress.h"
10 -
11 -#ifdef NO_PTHREADS
12 -static void preload_index(struct index_state *index,
13 - const struct pathspec *pathspec,
14 - unsigned int refresh_flags)
15 -{
16 - ; /* nothing */
17 -}
18 -#else
19 -
20 -#include <pthread.h>
10 +#include "thread-utils.h"
11
12 /*
13 * Mostly randomly chosen maximum thread counts: we
@@ -108,7 +98,7 @@ static void preload_index(struct index_state *index,
98 struct thread_data data[MAX_PARALLEL];
99 struct progress_data pd;
100
111 - if (!core_preload_index)
101 + if (!HAVE_THREADS || !core_preload_index)
102 return;
103
104 threads = index->cache_nr / THREAD_COST;
@@ -151,7 +141,6 @@ static void preload_index(struct index_state *index,
141
142 trace_performance_leave("preload index");
143 }
154 -#endif
144
145 int read_index_preload(struct index_state *index,
146 const struct pathspec *pathspec,