• Martin Möhrmann's avatar
    fmt: change padding functions to avoid package init · abcad1e5
    Martin Möhrmann authored
    Move the decision if zero padding is allowed to doPrintf
    where the other formatting decisions are made.
    
    Removes some dead code for negative f.wid that was never used
    due to f.wid always being positive and f.minus deciding if left
    or right padding should be used.
    
    New padding code writes directly into the buffer and is as fast
    as the old version but avoids the cost of needing package init.
    
    name              old time/op  new time/op  delta
    SprintfPadding-2   246ns ± 5%   245ns ± 4%   ~     (p=0.345 n=50+47)
    
    Change-Id: I7dfddbac8e328f4ef0cdee8fafc0d06c784b2711
    Reviewed-on: https://go-review.googlesource.com/19957
    Run-TryBot: Rob Pike <r@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    abcad1e5
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...