Skip to content

Commit

Permalink
Clarify some method signatures
Browse files Browse the repository at this point in the history
This makes the methods more readable.
  • Loading branch information
mrekucci committed Jul 19, 2015
1 parent a66c202 commit e0183c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions powerset.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ package epi
// PowerSet returns a power set of s.
// The length of s is limited to size of int.
// When the size is crossed then nil interface, and false is returned.
func PowerSet(s []interface{}) ([]interface{}, bool) {
var ps []interface{}
func PowerSet(s []interface{}) (ps []interface{}, ok bool) {
if len(s) >= intSize {
return ps, false
}
Expand Down
5 changes: 1 addition & 4 deletions spiralmetrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ func add(a [][]int, ac []int, off int) []int {

// Clockwise returns an array which elements are under
// clockwise spiral order of the original array a.
func Clockwise(a [][]int) []int {
var ac []int

func Clockwise(a [][]int) (ac []int) {
// Center of a.
ctr := len(a) >> 1
if len(a)%2 != 0 {
Expand All @@ -49,6 +47,5 @@ func Clockwise(a [][]int) []int {
for off := 0; off < ctr; off++ {
ac = add(a, ac, off)
}

return ac
}

0 comments on commit e0183c8

Please sign in to comment.