Google.VersionHandler.FileMetadataSet.FindWithPendingUpdates C# (CSharp) Method

FindWithPendingUpdates() public static method

Filter the a set for files which have multiple versions and those with metadata that selects the set of target platforms.
public static FindWithPendingUpdates ( FileMetadataSet metadataSet ) : FileMetadataSet
metadataSet FileMetadataSet Set to filter.
return FileMetadataSet
        public static FileMetadataSet FindWithPendingUpdates(
                FileMetadataSet metadataSet) {
            FileMetadataSet outMetadataSet = new FileMetadataSet();
            foreach (var filenameAndMetadata in
                     metadataSet.metadataByCanonicalFilename) {
                var metadataByVersion = filenameAndMetadata.Value.Values;
                bool needsUpdate = metadataByVersion.Count > 1;
                if (!needsUpdate) {
                    foreach (var metadata in metadataByVersion) {
                        if ((metadata.targets != null &&
                             metadata.targets.Length > 0) ||
                            metadata.isManifest) {
                            needsUpdate = true;
                            break;
                        }
                    }
                }
                if (needsUpdate) {
                    outMetadataSet.metadataByCanonicalFilename[
                        filenameAndMetadata.Key] = filenameAndMetadata.Value;
                }
            }
            return outMetadataSet;
        }