further tidying
This commit is contained in:
@@ -371,6 +371,29 @@ func (expr *Expression) domFieldHandler(s string) error {
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
func populateOne(values map[int]bool, v int) {
|
||||
values[v] = true
|
||||
}
|
||||
|
||||
func populateMany(values map[int]bool, min, max, step int) {
|
||||
for i := min; i <= max; i += step {
|
||||
values[i] = true
|
||||
}
|
||||
}
|
||||
|
||||
func toList(set map[int]bool) []int {
|
||||
list := make([]int, len(set))
|
||||
i := 0
|
||||
for k := range set {
|
||||
list[i] = k
|
||||
i += 1
|
||||
}
|
||||
sort.Ints(list)
|
||||
return list
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
func genericFieldParse(s string, desc fieldDescriptor) ([]*cronDirective, error) {
|
||||
// At least one entry must be present
|
||||
indices := entryFinder.FindAllStringIndex(s, -1)
|
||||
@@ -451,29 +474,6 @@ func genericFieldParse(s string, desc fieldDescriptor) ([]*cronDirective, error)
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
func populateOne(values map[int]bool, v int) {
|
||||
values[v] = true
|
||||
}
|
||||
|
||||
func populateMany(values map[int]bool, min, max, step int) {
|
||||
for i := min; i <= max; i += step {
|
||||
values[i] = true
|
||||
}
|
||||
}
|
||||
|
||||
func toList(set map[int]bool) []int {
|
||||
list := make([]int, len(set))
|
||||
i := 0
|
||||
for k := range set {
|
||||
list[i] = k
|
||||
i += 1
|
||||
}
|
||||
sort.Ints(list)
|
||||
return list
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
func makeLayoutRegexp(layout, value string) *regexp.Regexp {
|
||||
layout = strings.Replace(layout, `%value%`, value, -1)
|
||||
re := layoutRegexp[layout]
|
||||
|
||||
Reference in New Issue
Block a user