mirror of
https://github.com/gonum/gonum.git
synced 2025-10-05 15:16:59 +08:00
graph: make state of empty less contradictory and provide debugging strings
This commit is contained in:
@@ -286,9 +286,9 @@ var (
|
||||
_ WeightedLineSlicer = Empty
|
||||
)
|
||||
|
||||
const nothing = empty(true)
|
||||
const nothing = empty(0)
|
||||
|
||||
type empty bool
|
||||
type empty int
|
||||
|
||||
func (empty) Next() bool { return false }
|
||||
func (empty) Len() int { return 0 }
|
||||
@@ -303,3 +303,6 @@ func (empty) Line() Line { return nil }
|
||||
func (empty) LineSlice() []Line { return nil }
|
||||
func (empty) WeightedLine() WeightedLine { return nil }
|
||||
func (empty) WeightedLineSlice() []WeightedLine { return nil }
|
||||
|
||||
func (empty) String() string { return "<empty>" }
|
||||
func (empty) GoString() string { return "graph.Empty" }
|
||||
|
Reference in New Issue
Block a user