void LoadDomains() { using(MethodTracer tracer = new MethodTracer(m_logger)) { // // Load the domains and order them by the length in descending order // This helps us do longest domain matches more efficiently // m_domains = (from domain in this.m_store.Domains select domain.Name).OrderByDescending<string, int>(x => x.Length).ToArray(); // // And precompute a version of the domain list, this time with '.' prepended // Just a simplification so we don't have to keep doing it at runtime. // Makes it a bit faster too // m_dottedDomains = (from domain in m_domains select '.' + domain).ToArray(); if (m_domains == null) { m_domains = new string[0]; } if (m_dottedDomains == null) { m_dottedDomains = new string[0]; } } }
void InitStore() { using(MethodTracer tracer = new MethodTracer(m_logger)) { m_store = new ConfigStore(m_settings.StoreConnectString, m_settings.QueryTimeout); this.LoadDomains(); } }