aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/link-rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/link-rule.cxx')
-rw-r--r--libbuild2/cc/link-rule.cxx28
1 files changed, 1 insertions, 27 deletions
diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx
index 0482fcb..98b6b9e 100644
--- a/libbuild2/cc/link-rule.cxx
+++ b/libbuild2/cc/link-rule.cxx
@@ -1718,33 +1718,7 @@ namespace build2
{
// Hoist the elements corresponding to this library to the end.
//
- if (al->begin != al->end)
- {
- // Rotate to the left the subrange starting from the first element
- // of this library and until the end so that the element after the
- // last element of this library becomes the first element of this
- // subrange. We also need to adjust begin/end of libraries
- // affected by the rotation.
- //
- rotate (d.args.begin () + al->begin,
- d.args.begin () + al->end,
- d.args.end ());
-
- size_t n (al->end - al->begin);
-
- for (appended_library& al1: d.ls)
- {
- if (al1.begin >= al->end)
- {
- al1.begin -= n;
- al1.end -= n;
- }
- }
-
- al->end = d.args.size ();
- al->begin = al->end - n;
- }
-
+ d.ls.hoist (d.args, *al);
return;
}