]> git.lizzy.rs Git - rust.git/commit
Optimize for the most common cases of `format!`
authorPiotr Czarnecki <pioczarn@gmail.com>
Mon, 25 Aug 2014 13:26:18 +0000 (14:26 +0100)
committerPiotr Czarnecki <pioczarn@gmail.com>
Tue, 9 Sep 2014 19:34:41 +0000 (20:34 +0100)
commit5aaa60693222c98c92fbde830f9a85c24f2e3f4f
tree8e9008e1c6e88131acd62ed5c6cb9977962101cf
parent696367fb8de63a3ff264c65981457b9fbd0e7b06
Optimize for the most common cases of `format!`

Format specs are ignored and not stored in case they're all default.
Restore default formatting parameters during iteration.
Pass `None` instead of empty slices of format specs to take advantage
of non-nullable pointer optimization.

Generate a call to one of two functions of `fmt::Argument`.
src/libcore/fmt/mod.rs
src/libsyntax/ext/format.rs