ArrayUnion Concats two arrays of int's into one.
(to, from []int)
| 84 | |
| 85 | // ArrayUnion Concats two arrays of int's into one. |
| 86 | func ArrayUnion(to, from []int) (concat []int) { |
| 87 | concat = to |
| 88 | for i := range from { |
| 89 | if !Contains(concat, from[i]) { |
| 90 | concat = IntArrayCapUp(concat) |
| 91 | concat[len(concat)-1] = from[i] |
| 92 | } |
| 93 | } |
| 94 | return concat |
| 95 | } |
| 96 | |
| 97 | // GetParent Function that finds the first previous state of a state and returns it. |
| 98 | // Used for trie where there is only one parent. |
no test coverage detected