FirstElements Sets elems to be the first elements in the ordering. So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} then we are guaranteed that the total ordering will begin with {D, B, A}
(elems ...string)
| 52 | // So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} |
| 53 | // then we are guaranteed that the total ordering will begin with {D, B, A} |
| 54 | func (ord *PartialOrdering) FirstElements(elems ...string) { |
| 55 | if ord.firstSealed { |
| 56 | panic("FirstElements has already been called") |
| 57 | } |
| 58 | // We make every node in the dag have a dependency on elems[-1] |
| 59 | // then we change elems[-1] to depend on elems[-2], and so forth. |
| 60 | err := ord.dag.AddFirstElements(elems...) |
| 61 | handleDAGErr(err) |
| 62 | ord.firstSealed = true |
| 63 | } |
| 64 | |
| 65 | // LastElements Sets elems to be the last elements in the ordering. |
| 66 | // So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} |