Skip to content

Commit 07c8faf

Browse files
committed
♻️ 要素数0のスライスならvarで初期化できるので置き換え
1 parent 677bd9b commit 07c8faf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/grouping/grouping.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ func (iter intIterator) take(n int) intIterator {
5757

5858
// IntIterator の中身を全て昇順ソートしたイテレータを返却するメソッド
5959
func (iter intIterator) sorted() intIterator {
60-
// 要素数0のint型スライスを生成する
61-
seq := make([]int, 0)
60+
// イテレータから取り出したint型の値を格納するスライス
61+
var seq []int
62+
6263
// イテレータから要素を取り出してスライスに追加していく
6364
for {
6465
v, err := iter()

0 commit comments

Comments
 (0)