-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect unique on nat_gateway-subnet edge
- Loading branch information
1 parent
48051e7
commit 3adac19
Showing
14 changed files
with
236 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package construct2 | ||
|
||
// SortedIds is a helper type for sorting ResourceIds by purely their content, for use when deterministic ordering | ||
// is desired (when no other sources of ordering are available). | ||
type SortedIds []ResourceId | ||
|
||
func (s SortedIds) Len() int { | ||
return len(s) | ||
} | ||
|
||
func ResourceIdLess(a, b ResourceId) bool { | ||
if a.Provider != b.Provider { | ||
return a.Provider < b.Provider | ||
} | ||
if a.Type != b.Type { | ||
return a.Type < b.Type | ||
} | ||
if a.Namespace != b.Namespace { | ||
return a.Namespace < b.Namespace | ||
} | ||
return a.Name < b.Name | ||
} | ||
|
||
func (s SortedIds) Less(i, j int) bool { | ||
return ResourceIdLess(s[i], s[j]) | ||
} | ||
|
||
func (s SortedIds) Swap(i, j int) { | ||
s[i], s[j] = s[j], s[i] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.