14
ruant
7y

"By design, the All operator returns true for an empty sequence."

You cunt face!

Comments
  • 2
    Lol, had something similar a few months ago the fucking ldap lib login function in php returns true if you provide an empty password wtf.
  • 0
    Just check before and wrap it into an extension method... i did the same with sum and average as they throw Exceptions on empty enumerables.
  • 0
    Yeah. This has caught me out a few times and it makes me rage constantly.

    I genuinely don’t understand why they made this decision, it’s so stupid.

    I guess at a stretch you can say that yes, the predicate does apply to all elements of the set because the set is empty, but it’s so fucking counterintuitive.
  • 1
    @Brolls Wikipedia says that the universal quantification of the empty set is by convention always true.
  • 0
    Never seen any implementation that would return false. If a predicate is true for all elements in a set, it should not magically become false when you remove 1, 2, .., all elements.
Add Comment