From 77fc9816696ebed3cc8685a8fdee464799f2a157 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 18 Apr 2022 13:49:16 +0200 Subject: Skip find() inside target_set::insert*() if target is unlikely to be there --- libbuild2/target.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libbuild2/target.cxx') diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx index 7eaa3a6..4f11b54 100644 --- a/libbuild2/target.cxx +++ b/libbuild2/target.cxx @@ -698,10 +698,11 @@ namespace build2 optional ext, target_decl decl, tracer& trace, + bool skip_find, bool need_lock) { target_key tk {&tt, &dir, &out, &name, move (ext)}; - target* t (const_cast (find (tk, trace))); + target* t (skip_find ? nullptr : const_cast (find (tk, trace))); if (t == nullptr) { -- cgit v1.1