File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change
1
+ 3.0
Original file line number Diff line number Diff line change @@ -1238,11 +1238,11 @@ open class $ {
1238
1238
/// - parameter matrix: Generic matrix containing any type.
1239
1239
/// - returns: A transposed version of input matrix.
1240
1240
open class func transpose< T> ( _ matrix: [ [ T ] ] ) -> [ [ T ] ] {
1241
- guard matrix. filter ( { return $0. count == matrix [ 0 ] . count } ) . count == matrix. count,
1242
- var returnMatrix: [ [ T ? ] ] = Array ( repeating: Array ( repeating: nil , count: matrix. count) ,
1243
- count: matrix. first!. count) else {
1241
+ guard matrix. filter ( { return $0. count == matrix [ 0 ] . count } ) . count == matrix. count else {
1244
1242
return matrix
1245
1243
}
1244
+ var returnMatrix : [ [ T ? ] ] = Array ( repeating: Array ( repeating: nil , count: matrix. count) ,
1245
+ count: matrix. first!. count)
1246
1246
for (rowNumber, row) in matrix. enumerated ( ) {
1247
1247
for (index, item) in row. enumerated ( ) {
1248
1248
returnMatrix [ index] [ rowNumber] = item
You can’t perform that action at this time.
0 commit comments