aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-26 15:48:19 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-26 15:48:19 +0100
commiteeb5289f24447600150fc4af1d25634cb6c7dee9 (patch)
tree2929999bd563a89319c3087d19672fde66d21108
parenta268d91c061bbba1f8303ba88b1884f9a88f2fd5 (diff)
Minor optimization
-rw-r--r--messages.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/messages.go b/messages.go
index f1bda5f..c6f11ae 100644
--- a/messages.go
+++ b/messages.go
@@ -58,10 +58,9 @@ func (a Authorization) Supported(sol map[ChalType]Solver) []Challenge {
}
for _, com := range a.Combinations {
if supported(com) {
- var c []Challenge
- for _, n := range com {
- ch := a.Challenges[n]
- c = append(c, ch)
+ c := make([]Challenge, len(com))
+ for i, n := range com {
+ c[i] = a.Challenges[n]
}
return c
}