X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbinarycomponent.cpp;h=608ed3f6596b51b13522333358f2214cf6f093c1;hb=aa053d637e8259755af7d2e4b510a242f4d29c7b;hp=f1aaa0eb006b22a5366a1b5bc12766e08806b45e;hpb=9f885c3eec8f065b7dc400acfb9dd67158284fcf;p=builder.git diff --git a/source/binarycomponent.cpp b/source/binarycomponent.cpp index f1aaa0e..608ed3f 100644 --- a/source/binarycomponent.cpp +++ b/source/binarycomponent.cpp @@ -53,8 +53,9 @@ void BinaryComponent::create_targets() const const Toolchain &toolchain = builder.get_toolchain(); const Toolchain &pkg_tools = package.get_toolchain(); - list objs; - list source_filenames = collect_source_files(); + vector objs; + vector source_filenames = collect_source_files(); + objs.reserve(source_filenames.size()); for(auto i=source_filenames.begin(); i!=source_filenames.end(); ++i) { string ext = FS::extpart(FS::basename(*i)); @@ -63,22 +64,21 @@ void BinaryComponent::create_targets() const Tool *gen = pkg_tools.get_tool_for_suffix(ext); if(gen) { - list templates; + vector templates; templates.push_back(gen->create_source(*this, *i)); Tool::ProcessingUnit processing_unit = gen->get_processing_unit(); if(processing_unit!=Tool::ONE_FILE) { FS::Path source_dir = FS::dirname(*i); - auto j = i; - for(++j; j!=source_filenames.end(); ) + for(auto j=next(i); j!=source_filenames.end(); ) { if((processing_unit!=Tool::DIRECTORY || FS::dirname(*j)==source_dir) && pkg_tools.get_tool_for_suffix(FS::extpart(FS::basename(*j)))==gen) { templates.push_back(gen->create_source(*this, *j)); // Remove additional files so they won't get processed again - source_filenames.erase(j++); + j = source_filenames.erase(j); } else ++j; @@ -117,7 +117,8 @@ void BinaryComponent::create_targets() const Tool &linker = toolchain.get_tool("LINK"); - list results; + vector results; + results.reserve(2); if(type==LIBRARY) { Tool &archiver = toolchain.get_tool("AR");