Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
Merge pull request etcd-io#5677 from gyuho/minor_etcdserver_fix
Browse files Browse the repository at this point in the history
etcdserver: preallocate slices
  • Loading branch information
gyuho authored Jun 15, 2016
2 parents b98fa06 + 32d766d commit 7d666ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etcdserver/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ func getIDs(snap *raftpb.Snapshot, ents []raftpb.Entry) []uint64 {
plog.Panicf("ConfChange Type should be either ConfChangeAddNode or ConfChangeRemoveNode!")
}
}
sids := make(types.Uint64Slice, 0)
sids := make(types.Uint64Slice, 0, len(ids))
for id := range ids {
sids = append(sids, id)
}
Expand Down

0 comments on commit 7d666ab

Please sign in to comment.