Skip to content

Conversation

@tomerd
Copy link
Contributor

@tomerd tomerd commented Sep 7, 2023

motivation: small perforamnce gains

changes: replace filter{}.isEmpty with more efficient options like contains.where{ }

motivation: small perforamnce gains changes: * replace filter{}.isEmpty with more efficient options like contains.where{ }
@tomerd tomerd force-pushed the fix/no-filter-then-empty branch from efeb151 to 34987fc Compare September 7, 2023 21:27
contents += "(allow mach-lookup (global-name \"com.apple.lsd.mapdb\"))\n"

if allowNetworkConnections.filter({ $0 != .none }).isEmpty == false {
//if allowNetworkConnections.filter({ $0 != .none }).isEmpty == false {
Copy link
Contributor Author

@tomerd tomerd Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left the original one (here and elsewhere) to make sure I did not get it wrong. will remove when ready to merge

@neonichu
Copy link
Contributor

neonichu commented Sep 8, 2023

Not sure I am a fan of this, it seems like change for the sake of it, since none of the call sites seem like they would ever actually process collections of significant size. There's a real cost to these because they obscure the history, the real reason for any of this code is now one hop away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants