]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7475 : Seldaek/rust/fixsplit, r=cmr
authorbors <bors@rust-lang.org>
Sun, 30 Jun 2013 04:13:31 +0000 (21:13 -0700)
committerbors <bors@rust-lang.org>
Sun, 30 Jun 2013 04:13:31 +0000 (21:13 -0700)
I almost got locked out of my machine because I misunderstood the purpose of the function and called it with a limit of uint::max_value, which turned this function into an almost endless loop.

1  2 
src/libstd/str.rs

index a06d858e4243b4985f86e9ec6fe6eb1c805be83d,acf136689dc660e30c737cea98f75d5c68ddb410..8e0b3b6ad3552534479ee878a6105124a0263a5c
@@@ -463,10 -470,9 +470,9 @@@ pub fn each_split_within<'a>(ss: &'a st
          cont
      };
  
 -    ss.iter().enumerate().advance(machine);
 +    ss.iter().enumerate().advance(|x| machine(x));
  
      // Let the automaton 'run out' by supplying trailing whitespace
-     let mut fake_i = ss.len();
      while cont && match state { B | C => true, A => false } {
          machine((fake_i, ' '));
          fake_i += 1;