- IsPointInPolygon added
This commit is contained in:
23
utils/utils_sort.go
Normal file
23
utils/utils_sort.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package utils
|
||||
|
||||
type SortItem struct {
|
||||
CompareValue int64
|
||||
Index int
|
||||
}
|
||||
|
||||
type SortList []*SortItem
|
||||
|
||||
func (p SortList) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
|
||||
// Less reports whether the element with
|
||||
// index i should sort before the element with index j.
|
||||
func (p SortList) Less(i, j int) bool {
|
||||
return p[i].CompareValue < p[j].CompareValue
|
||||
}
|
||||
|
||||
// Swap swaps the elements with indexes i and j.
|
||||
func (p SortList) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
Reference in New Issue
Block a user