crypto/x509, go/scanner, index/suffixarray: Removed []interface{}/vector uses.

Changed some []interface{} uses to slices of the concrete types; removed use of IntVector.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/4810085
diff --git a/src/pkg/crypto/x509/x509.go b/src/pkg/crypto/x509/x509.go
index 0add9e3..8fda471 100644
--- a/src/pkg/crypto/x509/x509.go
+++ b/src/pkg/crypto/x509/x509.go
@@ -793,7 +793,7 @@
 // ParseCertificates parses one or more certificates from the given ASN.1 DER
 // data. The certificates must be concatenated with no intermediate padding.
 func ParseCertificates(asn1Data []byte) ([]*Certificate, os.Error) {
-	var v []interface{}
+	var v []*certificate
 
 	for len(asn1Data) > 0 {
 		cert := new(certificate)
@@ -806,8 +806,8 @@
 	}
 
 	ret := make([]*Certificate, len(v))
-	for i := 0; i < len(v); i++ {
-		cert, err := parseCertificate(v[i].(*certificate))
+	for i, ci := range v {
+		cert, err := parseCertificate(ci)
 		if err != nil {
 			return nil, err
 		}
diff --git a/src/pkg/go/scanner/errors.go b/src/pkg/go/scanner/errors.go
index 78dbc39..a0927e4 100644
--- a/src/pkg/go/scanner/errors.go
+++ b/src/pkg/go/scanner/errors.go
@@ -31,18 +31,14 @@
 // error handling is obtained.
 //
 type ErrorVector struct {
-	errors []interface{}
+	errors []*Error
 }
 
 // Reset resets an ErrorVector to no errors.
-func (h *ErrorVector) Reset() {
-	h.errors = h.errors[:0]
-}
+func (h *ErrorVector) Reset() { h.errors = h.errors[:0] }
 
 // ErrorCount returns the number of errors collected.
-func (h *ErrorVector) ErrorCount() int {
-	return len(h.errors)
-}
+func (h *ErrorVector) ErrorCount() int { return len(h.errors) }
 
 // Within ErrorVector, an error is represented by an Error node. The
 // position Pos, if valid, points to the beginning of the offending
@@ -118,9 +114,7 @@
 	}
 
 	list := make(ErrorList, len(h.errors))
-	for i := 0; i < len(h.errors); i++ {
-		list[i] = h.errors[i].(*Error)
-	}
+	copy(list, h.errors)
 
 	if mode >= Sorted {
 		sort.Sort(list)
diff --git a/src/pkg/index/suffixarray/suffixarray_test.go b/src/pkg/index/suffixarray/suffixarray_test.go
index bd37ba4..0237485 100644
--- a/src/pkg/index/suffixarray/suffixarray_test.go
+++ b/src/pkg/index/suffixarray/suffixarray_test.go
@@ -6,7 +6,6 @@
 
 import (
 	"bytes"
-	"container/vector"
 	"regexp"
 	"sort"
 	"strings"
@@ -107,7 +106,7 @@
 
 // find all occurrences of s in source; report at most n occurrences
 func find(src, s string, n int) []int {
-	var res vector.IntVector
+	var res []int
 	if s != "" && n != 0 {
 		// find at most n occurrences of s in src
 		for i := -1; n < 0 || len(res) < n; {
@@ -116,7 +115,7 @@
 				break
 			}
 			i += j + 1
-			res.Push(i)
+			res = append(res, i)
 		}
 	}
 	return res