From: Mikko Rasa Date: Fri, 30 Dec 2022 22:37:59 +0000 (+0200) Subject: Optimize Binary::collect_build_info X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fb227db74439dcece17291638b5587e11fcaf64f;p=builder.git 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. --- 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);