rust-lang/rust — pull request #20391 by daramos (2015-01-01 06:40:07+00:00)
Title: String::from_utf8_lossy reimplement minor optimization

Prior to 9bae6ec828fdc7f87838ee008cccef90e31b9f84 from_utf8_lossy had a minor optimization in place that avoided having to loop from the beginning of the input slice.
Recently 4908017d59da8694b9ceaf743baf1163c1e19086 implemented Utf8Error::InvalidByte which makes this possible again.