mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Hygiene: Reduce copy-pasted code.
This commit is contained in:
parent
c6f4b09f65
commit
6a98d269b5
1 changed files with 1 additions and 3 deletions
|
@ -204,7 +204,6 @@ func compareGetFloat(a interface{}, b interface{}) (float64, float64) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Intersect(l1, l2 interface{}) (interface{}, error) {
|
func Intersect(l1, l2 interface{}) (interface{}, error) {
|
||||||
|
|
||||||
if l1 == nil || l2 == nil {
|
if l1 == nil || l2 == nil {
|
||||||
return make([]interface{}, 0), nil
|
return make([]interface{}, 0), nil
|
||||||
}
|
}
|
||||||
|
@ -305,7 +304,6 @@ func indirect(v reflect.Value) (rv reflect.Value, isNil bool) {
|
||||||
// First is exposed to templates, to iterate over the first N items in a
|
// First is exposed to templates, to iterate over the first N items in a
|
||||||
// rangeable list.
|
// rangeable list.
|
||||||
func First(limit interface{}, seq interface{}) (interface{}, error) {
|
func First(limit interface{}, seq interface{}) (interface{}, error) {
|
||||||
|
|
||||||
limitv, err := cast.ToIntE(limit)
|
limitv, err := cast.ToIntE(limit)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue