From fb227db74439dcece17291638b5587e11fcaf64f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 31 Dec 2022 00:37:59 +0200 Subject: [PATCH] Optimize Binary::collect_build_info It's likely that all object files are built with very few different tools, evne just one. Updating the build info multiple times from the same tool is pointless. --- source/lib/binary.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/lib/binary.cpp b/source/lib/binary.cpp index f245037..9d73785 100644 --- a/source/lib/binary.cpp +++ b/source/lib/binary.cpp @@ -28,9 +28,13 @@ Binary::Binary(Builder &b, const Component &c, const string &p, const vector tools; for(ObjectFile *o: objects) if(const Tool *obj_tool = o->get_tool()) - binfo.update_from(obj_tool->get_build_info()); + if(!any_equals(tools, obj_tool)) + tools.push_back(obj_tool); + for(const Tool *t: tools) + binfo.update_from(t->get_build_info()); Target::collect_build_info(binfo); -- 2.43.0