about summary refs log tree commit diff
path: root/src/libextra/priority_queue.rs
AgeCommit message (Collapse)AuthorLines
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-388/+0
2014-02-04Rename reserve to reserve_exact and reserve_at_least to reserveDavid Manescu-5/+9
Changes in std::{str,vec,hashmap} and extra::{priority_queue,ringbuf}. Fixes #11949
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-2/+2
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-1/+1
2014-01-18Rename iterators for consistencyPalmer Cox-5/+5
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-4/+0
(implicitly) less_eq.
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-2/+6
This moves the custom sorting to `.sort_by`.
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-6/+9
Fixes #9676.
2013-12-11Make 'self lifetime illegal.Erik Price-4/+4
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-1/+1
Closes #9467
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+0
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-5/+14
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-3/+0
2013-08-15std: Move the iterator param on FromIterator and Extendable to the method.Huon Wilson-4/+4
If they are on the trait then it is extremely annoying to use them as generic parameters to a function, e.g. with the iterator param on the trait itself, if one was to pass an Extendable<int> to a function that filled it either from a Range or a Map<VecIterator>, one needs to write something like: fn foo<E: Extendable<int, Range<int>> + Extendable<int, Map<&'self int, int, VecIterator<int>>> (e: &mut E, ...) { ... } since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>` means that `foo` takes 2 type parameters, and the caller has to specify them (which doesn't work anyway, as they'll mismatch with the iterators used in `foo` itself). This patch changes it to: fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-1/+1
cc #5898
2013-08-03remove obsolete `foreach` keywordDaniel Micay-3/+3
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-3/+3
2013-07-30extra: Implement iterator::Extendableblake2-ppc-7/+14
2013-07-25Added default impls for container methodsSteven Fackler-3/+0
A couple of implementations of Container::is_empty weren't exactly self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-17test: Fix tests.Patrick Walton-1/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-2/+2
2013-07-14Stripped trailing spaces; Implemented FromIterator for TreeMap and PriorityQueue=Mark Sinclair-0/+27
2013-07-06Implement size_hint() on all remaining IteratorsKevin Ballard-0/+3
Add size_hint() to the Iterators in libextra and the Iterator in libsyntax. Skip deque for the moment, as it's being worked on elsewhere.
2013-06-30Convert vec::{reverse, swap} to methods.Huon Wilson-1/+1
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-4/+3
2013-06-28Convert vec::{reserve, reserve_at_least, capacity} to methods.Huon Wilson-3/+3
2013-06-26priority_queue: implement simple iteratorRamkumar Ramachandra-4/+27
Remove PriorityQueue::each and replace it with PriorityQueue::iter, which ultimately calls into vec::VecIterator via PriorityQueueIterator. Implement iterator::Iterator for PriorityQueueIterator. Now you should be able to do: extern mod extra; let mut pq = extra::priority_queue::PriorityQueue::new(); pq.push(5); pq.push(6); pq.push(3); for pq.iter().advance |el| { println(fmt!("%d", *el)); } just like you iterate over vectors, hashmaps, hashsets etc. Note that the iteration order is arbitrary (as before with PriorityQueue::each), and _not_ the order you get when you pop() repeatedly. Add an in-file test to guard this. Reported-by: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-24remove old_iterDaniel Micay-11/+6
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-23vec: remove BaseIter implementationDaniel Micay-2/+2
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-15rm vec::uniq_lenDaniel Micay-2/+2
2013-06-09cmp: remove duplicate free functionsDaniel Micay-5/+5
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-19/+20
2013-05-30libextra: Require documentation by defaultAlex Crichton-0/+1
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+1
2013-05-23cleanup warnings from libextraErick Tryzelaar-1/+0
2013-05-22test: Update tests and import the prelude in some more places.Patrick Walton-12/+12
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+2
to libextra
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+320
This only changes the directory names; it does not change the "real" metadata names.