-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Tracking issue for map_first_last: first/last methods on BTreeSet and BTreeMap #62924
Copy link
Copy link
Closed
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(map_first_last)]Public API
Steps / History
Unresolved Questions
Original issue title: Finding minimum/maximum element in BTreeMap does twice the required amount of computation
Original issue text:
The standard way of finding the minimum element in BTreeMap is
tree_map.iter().next()The
iter()function creates abtree_map::Iter, which finds both the minimum and maximum element to create its internal instance ofbtree_map::Range.This is unnecessary, and a
BTreeMap::get_minor similar function could be provided, which would just internally call thefirst_leaf_edgeprivate function, without needing to calllast_leaf_edge.Ditto for finding the maximum element.