Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Sources/SwiftGraph/Graph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ extension Graph {
public var edgeCount: Int {
return edges.joined().count
}

@available(*, deprecated, renamed: "addEdge", message: "Use the addEdge method without the additional directed parameter instead, as the Edge contains already the information about direction. A double specification can only result in inconsistencies and errors.")
func addEdge(_ e: E, directed: Bool = false){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func addEdge(_ e: E, directed: Bool = false){
func addEdge(_ e: E, directed: Bool = false) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, you found an outdated version. I removed the default value (false) in the latest version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the default value there is a more clear distinction between the one-parameter version and the 2-parameter. And there is no confusion that you use the one-parameter version when you leave out the default parameter - and not using the default value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting updated.

addEdge(e)
}

/// Returns a list of all the edges, undirected edges are only appended once.
public func edgeList() -> [E] {
Expand Down