aboutsummaryrefslogtreecommitdiff
path: root/src/time/sleep_test.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2023-05-02 01:06:11 +0700
committerShulhan <m.shulhan@gmail.com>2024-01-25 04:01:14 +0700
commit8096b47dd09fcda8712f7a3c07dced5244123a4d (patch)
tree26339e20861f0d89cff1cf3dc763d7b99b4aaee8 /src/time/sleep_test.go
parent54386c4a7e68ab281545116220600f670e8f9e14 (diff)
downloadgo-8096b47dd09fcda8712f7a3c07dced5244123a4d.tar.xz
all: prealloc slice with possible minimum capabilities
Diffstat (limited to 'src/time/sleep_test.go')
-rw-r--r--src/time/sleep_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/time/sleep_test.go b/src/time/sleep_test.go
index b25606dfed..201a390642 100644
--- a/src/time/sleep_test.go
+++ b/src/time/sleep_test.go
@@ -373,8 +373,8 @@ func testAfterQueuing(delta Duration) error {
for _, slot := range slots {
go await(slot, result, After(Duration(slot)*delta))
}
- var order []int
- var times []Time
+ order := make([]int, 0, len(slots))
+ times := make([]Time, 0, len(slots))
for range slots {
r := <-result
order = append(order, r.slot)