about summary refs log tree commit diff
path: root/src/libextra/bitv.rs
AgeCommit message (Collapse)AuthorLines
2014-02-07moved collections from libextra into libcollectionsHeroesGrave-1675/+0
2014-01-25Uppercase numeric constantsChris Wong-31/+31
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-23Update flip() to be rev().Sean Chalmers-3/+3
Consensus leaned in favour of using rev instead of flip.
2014-01-23Rename Invert to Flip - Issue 10632Sean Chalmers-4/+4
Renamed the invert() function in iter.rs to flip(). Also renamed the Invert<T> type to Flip<T>. Some related code comments changed. Documentation that I could find has been updated, and all the instances I could locate where the function/type were called have been updated as well.
2014-01-18auto merge of #11615 : adwhit/rust/master, r=cmrbors-7/+30
This is my first patch so feedback appreciated! Bug when initialising `bitv:Bitv::new(int,bool)` when `bool=true`. It created a `Bitv` with underlying representation `!0u` rather than the actual desired bit layout ( e.g. `11111111` instead of `00001111`). This works OK because a size attribute is included which keeps access to legal bounds. However when using `BitvSet::from_bitv(Bitv)`, we then find that `bitvset.contains(i)` can return true when `i` should not in fact be in the set. ``` let bs = BitvSet::from_bitv(Bitv::new(100, true)); assert!(!bs.contains(&127)) //fails ``` The fix is to create the correct representation by treating various cases separately and using a bitshift `(1<<nbits) - 1` to generate correct number of `1`s where necessary.
2014-01-18Rename iterators for consistencyPalmer Cox-14/+14
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2014-01-17Fixed bug when initialising bitv from bool=trueAlex Whitney-7/+30
2014-01-06Remove some unnecessary type castsFlorian Hahn-1/+1
Conflicts: src/librustc/middle/lint.rs
2013-12-17Don't allow impls to force public typesAlex Crichton-1/+2
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
2013-12-11Make 'self lifetime illegal.Erik Price-9/+9
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-08Remove dead codesKiet Tran-5/+3
2013-11-28Register new snapshotsAlex Crichton-2/+2
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-36/+36
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-16/+22
`librustuv`.
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-14/+14
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-12/+12
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-4/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-2/+6
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-3/+3
Who doesn't like a massive renaming?
2013-10-09std::rand: Add a trait for seeding RNGs: SeedableRng.Huon Wilson-2/+2
This provides 2 methods: .reseed() and ::from_seed that modify and create respecitively. Implement this trait for the RNGs in the stdlib for which this makes sense.
2013-10-09std::rand: Add an implementation of ISAAC64.Huon Wilson-8/+8
This is 2x faster on 64-bit computers at generating anything larger than 32-bits. It has been verified against the canonical C implementation from the website of the creator of ISAAC64. Also, move `Rng.next` to `Rng.next_u32` and add `Rng.next_u64` to take full advantage of the wider word width; otherwise Isaac64 will always be squeezed down into a u32 wasting half the entropy and offering no advantage over the 32-bit variant.
2013-09-30extra: Remove usage of fmt!Alex Crichton-3/+3
2013-09-26auto merge of #9523 : huonw/rust/kud1ing-docs, r=huonwbors-24/+24
Collation of @kud1ing's work in #9511, #9512, #9513 and #9518.
2013-09-26bitv: backticks for code in documentationkud1ing-24/+24
2013-09-25Rename from_utf8 to from_bytes againFlorian Hahn-4/+4
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-2/+2
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-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-4/+4
2013-09-01std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iteratorsblake2-ppc-0/+2
2013-08-10std: Rename Iterator.transform -> .mapErick Tryzelaar-3/+3
cc #5898
2013-08-07std: Fix for-range loops that can use iteratorsblake2-ppc-8/+9
Fix inappropriate for-range loops to use for-iterator constructs (or other appropriate solution) instead.
2013-08-06std: Remove uint::iterate, replaced by `range`blake2-ppc-4/+3
2013-08-06extra: Simplify the bitv iterators using Repeatblake2-ppc-44/+19
2013-08-03remove obsolete `foreach` keywordDaniel Micay-21/+21
this has been replaced by `for`
2013-08-03Rename sum -> _sum.OGINO Masanori-6/+6
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-19/+22
2013-08-02replace `range` with an external iteratorDaniel Micay-9/+8
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-1/+1
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01std: Remove the internal iterator methods from trait Setblake2-ppc-35/+35
.intersection(), .union() etc methods in trait std::container::Set use internal iters. Remove these methods from the trait. I reported issue #8154 for the reinstatement of iterator-based set algebra methods to the Set trait. For bitv and treemap, that lack Iterator implementations of set operations, preserve them as methods directly on the types themselves. For HashSet, these methods are replaced by the present .union_iter() etc.
2013-08-01extra: Use external iterators in bitv implementationblake2-ppc-33/+55
Convert some internally used functions to use a external iterators. Change all uses of remaining internal iterators to use `do` expr
2013-08-01extra: Replace `for` with `do { .. }` expr where internal iterators are usedblake2-ppc-20/+25
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-10/+10
2013-07-30extra: Add .rev_iter() for bitvblake2-ppc-0/+5
2013-07-30extra: Implement DoubleEnded and RandomAccess iterators for bitvblake2-ppc-4/+35
2013-07-25Added default impls for container methodsSteven Fackler-1/+1
A couple of implementations of Container::is_empty weren't exactly self.len() == 0 so I left them alone (e.g. Treemap).
2013-07-21Added bitv iterator benchmarksSteven Fackler-0/+36
2013-07-21Added iterator testsSteven Fackler-0/+19
2013-07-21Removed unecessary indirection in BitvSteven Fackler-16/+16
BitvVariant is the same size as it was before (16 bytes).
2013-07-21Derive Clone for bitv stuffSteven Fackler-18/+24
2013-07-21Switched bitv to external iteratorsSteven Fackler-17/+54
2013-07-18Fix warnings in libextra testsblake2-ppc-25/+25
Most of these are "unneccesary allocation" in bitv, for ~[false, ..] instead of [false, ..].