The or-assign operator (|=
) sets the variable on the LHS to the value it previously contained OR-ed with the result of evaluating the RHS. For boolean types (as in this example) it changes the variable to contain true when the value is true (and otherwise has no net effect). It does not short-circuit evaluate.
The overall effect of the method is to call the current object's add
method for each element of the argument collection, and to return true if any of those calls to add
return true (i.e., if anything actually got added, under reasonable assumptions about the meaning of the result of add
…)