Skip to content

Commit 9c49d35

Browse files
committed
---
yaml --- r: 56223 b: refs/heads/auto c: 2686dcb h: refs/heads/master i: 56221: 9c3e7b8 56219: 811b8bc 56215: 9a81fa4 56207: d9e312b 56191: e31a9c2 v: v3
1 parent ac20263 commit 9c49d35

File tree

15 files changed

+454
-372
lines changed

15 files changed

+454
-372
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: a523abd75c619be64cb8c0613431150e0913c934
17+
refs/heads/auto: 2686dcb98e7a48ea45fad3ea21e6406e26c97834
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/io.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub trait ReaderUtil {
176176
fn read_bytes(&self, len: uint) -> ~[u8];
177177

178178
/**
179-
* Reads up until a specific character or EOF.
179+
* Reads up until a specific byte is seen or EOF.
180180
*
181181
* The `include` parameter specifies if the character should be included
182182
* in the returned string.
@@ -185,7 +185,7 @@ pub trait ReaderUtil {
185185
*
186186
* None right now.
187187
*/
188-
fn read_until(&self, c: char, include: bool) -> ~str;
188+
fn read_until(&self, c: u8, include: bool) -> ~str;
189189

190190
/**
191191
* Reads up until the first '\n' or EOF.
@@ -577,7 +577,7 @@ impl<T:Reader> ReaderUtil for T {
577577
bytes
578578
}
579579

580-
fn read_until(&self, c: char, include: bool) -> ~str {
580+
fn read_until(&self, c: u8, include: bool) -> ~str {
581581
let mut bytes = ~[];
582582
loop {
583583
let ch = self.read_byte();
@@ -593,7 +593,7 @@ impl<T:Reader> ReaderUtil for T {
593593
}
594594

595595
fn read_line(&self) -> ~str {
596-
self.read_until('\n', false)
596+
self.read_until('\n' as u8, false)
597597
}
598598

599599
fn read_chars(&self, n: uint) -> ~[char] {
@@ -667,7 +667,7 @@ impl<T:Reader> ReaderUtil for T {
667667
}
668668

669669
fn read_c_str(&self) -> ~str {
670-
self.read_until(0 as char, false)
670+
self.read_until(0u8, false)
671671
}
672672

673673
fn read_whole_stream(&self) -> ~[u8] {
@@ -693,7 +693,7 @@ impl<T:Reader> ReaderUtil for T {
693693
// include the \n, so that we can distinguish an entirely empty
694694
// line read after "...\n", and the trailing empty line in
695695
// "...\n\n".
696-
let mut line = self.read_until('\n', true);
696+
let mut line = self.read_until('\n' as u8, true);
697697

698698
// blank line at the end of the reader is ignored
699699
if self.eof() && line.is_empty() { break; }

branches/auto/src/libcore/iterator.rs

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ pub trait IteratorUtil<A> {
2222
// FIXME: #5898: should be called map
2323
fn transform<'r, B>(self, f: &'r fn(A) -> B) -> MapIterator<'r, A, B, Self>;
2424
fn filter<'r>(self, predicate: &'r fn(&A) -> bool) -> FilterIterator<'r, A, Self>;
25-
fn dropwhile<'r>(self, predicate: &'r fn(&A) -> bool) -> DropWhileIterator<'r, A, Self>;
26-
fn takewhile<'r>(self, predicate: &'r fn(&A) -> bool) -> TakeWhileIterator<'r, A, Self>;
2725
fn enumerate(self) -> EnumerateIterator<Self>;
2826
fn advance(&mut self, f: &fn(A) -> bool);
2927
}
@@ -50,16 +48,6 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
5048
EnumerateIterator{iter: self, count: 0}
5149
}
5250

53-
#[inline(always)]
54-
fn dropwhile<'r>(self, predicate: &'r fn(&A) -> bool) -> DropWhileIterator<'r, A, T> {
55-
DropWhileIterator{iter: self, flag: false, predicate: predicate}
56-
}
57-
58-
#[inline(always)]
59-
fn takewhile<'r>(self, predicate: &'r fn(&A) -> bool) -> TakeWhileIterator<'r, A, T> {
60-
TakeWhileIterator{iter: self, flag: false, predicate: predicate}
61-
}
62-
6351
/// A shim implementing the `for` loop iteration protocol for iterator objects
6452
#[inline]
6553
fn advance(&mut self, f: &fn(A) -> bool) {
@@ -141,61 +129,3 @@ impl<A, T: Iterator<A>> Iterator<(uint, A)> for EnumerateIterator<T> {
141129
}
142130
}
143131
}
144-
145-
pub struct DropWhileIterator<'self, A, T> {
146-
priv iter: T,
147-
priv flag: bool,
148-
priv predicate: &'self fn(&A) -> bool
149-
}
150-
151-
impl<'self, A, T: Iterator<A>> Iterator<A> for DropWhileIterator<'self, A, T> {
152-
#[inline]
153-
fn next(&mut self) -> Option<A> {
154-
let mut next = self.iter.next();
155-
if self.flag {
156-
next
157-
} else {
158-
loop {
159-
match next {
160-
Some(x) => {
161-
if (self.predicate)(&x) {
162-
next = self.iter.next();
163-
loop
164-
} else {
165-
self.flag = true;
166-
return Some(x)
167-
}
168-
}
169-
None => return None
170-
}
171-
}
172-
}
173-
}
174-
}
175-
176-
pub struct TakeWhileIterator<'self, A, T> {
177-
priv iter: T,
178-
priv flag: bool,
179-
priv predicate: &'self fn(&A) -> bool
180-
}
181-
182-
impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhileIterator<'self, A, T> {
183-
#[inline]
184-
fn next(&mut self) -> Option<A> {
185-
if self.flag {
186-
None
187-
} else {
188-
match self.iter.next() {
189-
Some(x) => {
190-
if (self.predicate)(&x) {
191-
Some(x)
192-
} else {
193-
self.flag = true;
194-
None
195-
}
196-
}
197-
None => None
198-
}
199-
}
200-
}
201-
}

branches/auto/src/libcore/num/f32.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,26 +288,32 @@ impl num::One for f32 {
288288

289289
#[cfg(notest)]
290290
impl ops::Add<f32,f32> for f32 {
291+
#[inline(always)]
291292
fn add(&self, other: &f32) -> f32 { *self + *other }
292293
}
293294
#[cfg(notest)]
294295
impl ops::Sub<f32,f32> for f32 {
296+
#[inline(always)]
295297
fn sub(&self, other: &f32) -> f32 { *self - *other }
296298
}
297299
#[cfg(notest)]
298300
impl ops::Mul<f32,f32> for f32 {
301+
#[inline(always)]
299302
fn mul(&self, other: &f32) -> f32 { *self * *other }
300303
}
301304
#[cfg(notest)]
302305
impl ops::Div<f32,f32> for f32 {
306+
#[inline(always)]
303307
fn div(&self, other: &f32) -> f32 { *self / *other }
304308
}
305309
#[cfg(notest)]
306310
impl ops::Modulo<f32,f32> for f32 {
311+
#[inline(always)]
307312
fn modulo(&self, other: &f32) -> f32 { *self % *other }
308313
}
309314
#[cfg(notest)]
310315
impl ops::Neg<f32> for f32 {
316+
#[inline(always)]
311317
fn neg(&self) -> f32 { -*self }
312318
}
313319

branches/auto/src/libcore/num/f64.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,26 +310,32 @@ impl num::One for f64 {
310310

311311
#[cfg(notest)]
312312
impl ops::Add<f64,f64> for f64 {
313+
#[inline(always)]
313314
fn add(&self, other: &f64) -> f64 { *self + *other }
314315
}
315316
#[cfg(notest)]
316317
impl ops::Sub<f64,f64> for f64 {
318+
#[inline(always)]
317319
fn sub(&self, other: &f64) -> f64 { *self - *other }
318320
}
319321
#[cfg(notest)]
320322
impl ops::Mul<f64,f64> for f64 {
323+
#[inline(always)]
321324
fn mul(&self, other: &f64) -> f64 { *self * *other }
322325
}
323326
#[cfg(notest)]
324327
impl ops::Div<f64,f64> for f64 {
328+
#[inline(always)]
325329
fn div(&self, other: &f64) -> f64 { *self / *other }
326330
}
327331
#[cfg(notest)]
328332
impl ops::Modulo<f64,f64> for f64 {
333+
#[inline(always)]
329334
fn modulo(&self, other: &f64) -> f64 { *self % *other }
330335
}
331336
#[cfg(notest)]
332337
impl ops::Neg<f64> for f64 {
338+
#[inline(always)]
333339
fn neg(&self) -> f64 { -*self }
334340
}
335341

0 commit comments

Comments
 (0)