-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cnmallocator: make newPortAllocator() infallible
The portAllocator constructor function newPortAllocator() takes no arguments; all its initial state is taken from hardcoded constants in the source code. Any failure to construct a port allocator must therefore be the result of a bug in the code, which can only be fixed with a code change. As there is nothing the caller can do at runtime to cause the failure, there is little value in returning the error to the caller. Change the constructor to panic on failure instead. Signed-off-by: Cory Snider <[email protected]>
- Loading branch information
Showing
3 changed files
with
15 additions
and
28 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