public override int GetHashCode() { if (IsNotAbsoluteUri) { return CalculateCaseInsensitiveHashCode(OriginalString); } // Consider moving hash code storage from m_Info.MoreInfo to m_Info UriInfo info = EnsureUriInfo(); if ((object)info.MoreInfo == null) { info.MoreInfo = new MoreInfo(); } int tempHash = info.MoreInfo.Hash; if (tempHash == 0) { string chkString = info.MoreInfo.RemoteUrl; if ((object)chkString == null) chkString = GetParts(UriComponents.HttpRequestUrl, UriFormat.SafeUnescaped); tempHash = CalculateCaseInsensitiveHashCode(chkString); if (tempHash == 0) { tempHash = 0x1000000; //making it not zero still large enough to be mapped to zero by a hashtable } info.MoreInfo.Hash = tempHash; } return tempHash; }
public Db4oHistoryService(Uri baseUri, bool resume) { m_Resume = resume; m_Db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), "NCrawlerHist_{0}.Yap".FormatWith(baseUri.GetHashCode())); ClearHistory(); }