about summary refs log tree commit diff
path: root/src/libextra/deque.rs
AgeCommit message (Collapse)AuthorLines
2013-07-11extra: Rename deque::Deque to ringbuf::RingBuf and impl trait Dequeblake2-ppc-684/+0
Let RingBuf have a logical name for a concrete type, and Deque is used for the Deque trait (implemented by RingBuf and dlist).
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-1/+2
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-07-06deque: Implement Clone and Eq for Dequeblake2-ppc-0/+49
2013-07-06deque: Remove obsolete methods .each() and .eachi()blake2-ppc-29/+0
2013-07-06deque: Implement Deque::with_capacity. Lower initial capacity to 8.blake2-ppc-2/+18
We need a reasonably small initial capacity to make Deques faster for the common case.
2013-07-06deque: Move the shorter part when growingblake2-ppc-7/+25
The deque is split at the marker lo, or logical index 0. Move the shortest part (split by lo) when growing. This way add_front is just as fast as add_back, on average.
2013-07-06deque: Change iterators to use the same index calculation as Dequeblake2-ppc-39/+39
The previous implementation of reverse iterators used modulus (%) of negative indices, which did work but was fragile due to dependency on the divisor.
2013-07-06deque: Add tests for mut_iter and mut_rev_iterblake2-ppc-1/+51
2013-07-06deque: Remove rendundant field hiblake2-ppc-22/+26
The deque is determined by vec self.elts.len(), self.nelts, and self.lo, and self.hi is calculated from these. self.hi is just the raw index of element number `self.nelts`
2013-07-06deque: Implement FromIteratorblake2-ppc-0/+27
So that deque can be used with IteratorUtil::collect()
2013-07-06deque: Speed up deque growth by a lotblake2-ppc-17/+20
Fix some issues with the deque being very slow, keep the same vec around instead of constructing a new. Move as few elements as possible, so the self.lo point is not moved after grow. [o o o o o|o o o] hi...^ ^.... lo grows to [. . . . .|o o o o o o o o|. . .] ^.. lo ^.. hi If the deque is append-only, it will result in moving no elements on grow. If the deque is prepend-only, all will be moved each time. The bench tests added show big improvements: Timed using `rust build -O --test extra.rs && ./extra --bench deque` Old version: test deque::tests::bench_add_back ... bench: 4976 ns/iter (+/- 9) test deque::tests::bench_add_front ... bench: 4108 ns/iter (+/- 18) test deque::tests::bench_grow ... bench: 416964 ns/iter (+/- 4197) test deque::tests::bench_new ... bench: 408 ns/iter (+/- 12) With this commit: test deque::tests::bench_add_back ... bench: 12 ns/iter (+/- 0) test deque::tests::bench_add_front ... bench: 16 ns/iter (+/- 0) test deque::tests::bench_grow ... bench: 1515 ns/iter (+/- 30) test deque::tests::bench_new ... bench: 419 ns/iter (+/- 3)
2013-07-06deque: Add tests and bench testsblake2-ppc-0/+56
Add a test that excercises deque growing. Add bench tests for grow, new, add_back, add_front, to expose how slow these functions are.
2013-07-06deque: Fix grow condition in add_frontblake2-ppc-1/+1
Without this, it will hit the assert in fn grow after 32 consecutive add_front.
2013-07-01rustc: add a lint to enforce uppercase statics.Huon Wilson-2/+2
2013-06-30auto merge of #7468 : cmr/rust/great_renaming, r=pcwaltonbors-12/+11
2013-06-29Removing a lot of usage of '&const'Alex Crichton-2/+2
2013-06-29Warning cleanupCorey Richardson-5/+5
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-11/+10
2013-06-28Convert vec::{reserve, reserve_at_least, capacity} to methods.Huon Wilson-7/+6
2013-06-26Fix deque testsCorey Richardson-4/+5
2013-06-26Fix whitespace issues (thanks @jedestep!)Corey Richardson-14/+9
2013-06-26Moving implementation details to a macroJed Estep-67/+28
2013-06-26A few iterator testsJed Estep-0/+31
2013-06-26iterators use deque orderingJed Estep-49/+72
2013-06-26deque iteratorJed Estep-0/+95
2013-06-16Add copies to type params with Copy boundNiko Matsakis-18/+18
2013-06-14rm MutableIterDaniel Micay-1/+1
replaced with mutable implementations of Iterator
2013-06-01Remove all uses of `pub impl`. rs=stylePatrick Walton-13/+13
2013-05-30libextra: Require documentation by defaultAlex Crichton-0/+1
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-0/+2
2013-05-27extra: Add reserve and reserve_at_least to extra::dequeTim Chevalier-0/+51
As called for in #4994
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/+329
This only changes the directory names; it does not change the "real" metadata names.