Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01efddb0 authored by Jeff Brown's avatar Jeff Brown
Browse files

Make make make faster.

Optimize common case of uniq-words where the word is not
actually duplicated.  Reduces make startup overhead.

Change-Id: I1bee13bbd08a7b01248f4452283a64a724663d02
parent 3e93aeae
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -98,7 +98,7 @@ empty :=
space := $(empty) $(empty)
space := $(empty) $(empty)
define uniq-word
define uniq-word
$(strip \
$(strip \
  $(if $(filter $(2),$(1)), \
  $(if $(filter-out 0 1,$(words $(filter $(2),$(1)))), \
    $(eval h := |||$(subst $(space),|||,$(strip $(1)))|||) \
    $(eval h := |||$(subst $(space),|||,$(strip $(1)))|||) \
    $(eval h := $(subst |||$(strip $(2))|||,|||$(space)|||,$(h))) \
    $(eval h := $(subst |||$(strip $(2))|||,|||$(space)|||,$(h))) \
    $(eval h := $(word 1,$(h)) $(2) $(wordlist 2,9999,$(h))) \
    $(eval h := $(word 1,$(h)) $(2) $(wordlist 2,9999,$(h))) \