mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 08:01:31 +00:00
lib.network: remove assertMsg usage
assertMsg sends our error message through a function call, even if the error condition doesn't trigger. This requires a lot of thunk allocation that can be easily avoided.
This commit is contained in:
@@ -104,9 +104,9 @@ let
|
||||
*/
|
||||
parseExpandedIpv6 =
|
||||
addr:
|
||||
assert lib.assertMsg (
|
||||
assert
|
||||
length addr == ipv6Pieces
|
||||
) "parseExpandedIpv6: expected list of integers with ${ipv6Pieces} elements";
|
||||
|| throw "parseExpandedIpv6: expected list of integers with ${ipv6Pieces} elements";
|
||||
let
|
||||
u16FromHexStr =
|
||||
hex:
|
||||
|
||||
Reference in New Issue
Block a user