]> git.lizzy.rs Git - rust.git/commit
syntax: Avoid reallocating or copying in CodeMap::new_filemap
authorUlrik Sverdrup <root@localhost>
Fri, 1 May 2015 15:08:39 +0000 (17:08 +0200)
committerUlrik Sverdrup <root@localhost>
Fri, 1 May 2015 17:51:31 +0000 (19:51 +0200)
commitda03c9df33177d77029c52f8a68a5d214a6e83c7
treeeca156ea8ad4fe9c6abd38fbb9032c13f0ddd080
parentee48e6d192166be08a57dc4f5ba14256c072e9c3
syntax: Avoid reallocating or copying in CodeMap::new_filemap

Avoid creating a new String when there is no BOM to strip, and
otherwises use .drain(..3) to strip the BOM using the same allocation.
src/libsyntax/codemap.rs
src/libsyntax/lib.rs