Skip to content

Instantly share code, notes, and snippets.

@PJensen
Created March 31, 2010 14:23
Show Gist options
  • Save PJensen/350382 to your computer and use it in GitHub Desktop.
Save PJensen/350382 to your computer and use it in GitHub Desktop.
/// <summary>
/// Computes scalar result from collection of booleans
/// </summary>
/// <param name="aBooleans">Array of booleans to be aggregated</param>
/// <returns>The aggregation of all booleans;
/// <value>true if all true, false if otherwise.</value>
/// </returns>
public bool aggregateBooleans(bool[] aBooleans)
{
bool tmpReturn = true;
foreach (bool iBool in aBooleans)
tmpReturn &= iBool;
return tmpReturn;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment