* Fix 8322 * Untabify * Untabify again * Yet More untabify * More untabify * Final untabify * Add CHANGELOG_PENDING * Apply suggestions from code review Co-authored-by: Justin Van Patten <jvp@justinvp.com> * PR feedback Co-authored-by: Justin Van Patten <jvp@justinvp.com>
26 lines
634 B
C#
26 lines
634 B
C#
// Copyright 2016-2021, Pulumi Corporation
|
|
|
|
using System;
|
|
using System.Collections.Immutable;
|
|
|
|
namespace Pulumi.Serialization
|
|
{
|
|
internal static class ImmutableDictionaryExtensions
|
|
{
|
|
public static bool AnyValues<TKey, TValue>(
|
|
this ImmutableDictionary<TKey, TValue> immutableDictionary,
|
|
Func<TValue, bool> predicate)
|
|
where TKey : notnull
|
|
{
|
|
foreach (var (_, val) in immutableDictionary)
|
|
{
|
|
if (predicate(val))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
}
|