Commit 0e9d7d43 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser
Browse files

bytes: return early in Repeat if count is 0

This matches the implementation of strings.Repeat and slightly increases
performance:

name      old time/op  new time/op  delta
Repeat-8   145ns ±12%   125ns ±29%  -13.35%  (p=0.009 n=10+10)

Change-Id: Ic0a0e2ea9e36591286a49def320ddb67fe0b2c50
Reviewed-on: https://go-review.googlesource.com/c/go/+/166399


Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent ca835484
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment