private bool ServiceConfigHasChanged(string servicePackageName, ServiceConfig serviceConfig) { ServiceConfig currentServiceConfig = ConfigReader.GetServiceConfig( this.applicationInstanceId, servicePackageName); HashSet <string> changedSections = (null == currentServiceConfig) ? serviceConfig.GetDiagnosticSections() : ServiceConfig.GetChangedSections( currentServiceConfig, serviceConfig); // Figure out whether the data collector is interested in any of the // changed sections. If so, it needs to be restarted. IEnumerable <string> relevantChanges = Enumerable.Intersect( this.dataCollector.RegisteredServiceConfigSections, changedSections); return(relevantChanges.Any()); }