From fd925af71c8b341f924cd8132301b52c6a086881 Mon Sep 17 00:00:00 2001 From: "Sergey V. Zhdanovskih" Date: Wed, 3 Jul 2024 01:07:02 +0300 Subject: [PATCH] Minor fix to GEDCOM tag hashes --- projects/GKCore/GDModel/GDMAddress.cs | 18 +++++++------- projects/GKCore/GDModel/GDMAssociation.cs | 2 +- projects/GKCore/GDModel/GDMChangeDate.cs | 2 +- .../GKCore/GDModel/GDMChildToFamilyLink.cs | 4 ++-- .../GKCore/GDModel/GDMCommunicationRecord.cs | 10 ++++---- projects/GKCore/GDModel/GDMCustomEvent.cs | 16 ++++++------- projects/GKCore/GDModel/GDMCutoutPosition.cs | 8 +++---- projects/GKCore/GDModel/GDMDate.cs | 14 +++++------ projects/GKCore/GDModel/GDMDateInterpreted.cs | 2 +- projects/GKCore/GDModel/GDMDatePeriod.cs | 4 ++-- projects/GKCore/GDModel/GDMDateRange.cs | 4 ++-- projects/GKCore/GDModel/GDMDateValue.cs | 2 +- projects/GKCore/GDModel/GDMFamilyRecord.cs | 6 ++--- projects/GKCore/GDModel/GDMFileReference.cs | 4 ++-- .../GDModel/GDMFileReferenceWithTitle.cs | 2 +- projects/GKCore/GDModel/GDMGroupRecord.cs | 2 +- .../GKCore/GDModel/GDMIndividualRecord.cs | 2 +- projects/GKCore/GDModel/GDMLanguage.cs | 2 +- projects/GKCore/GDModel/GDMLines.cs | 2 +- projects/GKCore/GDModel/GDMLocationLink.cs | 4 ++-- projects/GKCore/GDModel/GDMLocationName.cs | 6 ++--- projects/GKCore/GDModel/GDMLocationRecord.cs | 2 +- projects/GKCore/GDModel/GDMLocationType.cs | 4 ++-- projects/GKCore/GDModel/GDMMap.cs | 4 ++-- projects/GKCore/GDModel/GDMMultimediaLink.cs | 8 +++---- projects/GKCore/GDModel/GDMNoteRecord.cs | 2 +- projects/GKCore/GDModel/GDMNotes.cs | 4 ++-- projects/GKCore/GDModel/GDMPersonalName.cs | 24 +++++++++---------- projects/GKCore/GDModel/GDMPlace.cs | 6 ++--- projects/GKCore/GDModel/GDMPointer.cs | 2 +- projects/GKCore/GDModel/GDMRecord.cs | 4 ++-- .../GKCore/GDModel/GDMRecordWithEvents.cs | 2 +- .../GKCore/GDModel/GDMRepositoryRecord.cs | 4 ++-- projects/GKCore/GDModel/GDMResearchRecord.cs | 12 +++++----- projects/GKCore/GDModel/GDMSourceCitation.cs | 10 ++++---- .../GKCore/GDModel/GDMSourceCitationData.cs | 4 ++-- projects/GKCore/GDModel/GDMSourceData.cs | 2 +- projects/GKCore/GDModel/GDMSourceEvent.cs | 4 ++-- projects/GKCore/GDModel/GDMSourceRecord.cs | 14 +++++------ .../GKCore/GDModel/GDMSubmissionRecord.cs | 12 +++++----- projects/GKCore/GDModel/GDMSubmitterRecord.cs | 6 ++--- projects/GKCore/GDModel/GDMTag.cs | 4 ++-- projects/GKCore/GDModel/GDMTaskRecord.cs | 8 +++---- projects/GKCore/GDModel/GDMTime.cs | 8 +++---- projects/GKCore/GDModel/GDMUserReference.cs | 2 +- projects/GKCore/GKCore/HashCode.cs | 14 +++-------- 46 files changed, 136 insertions(+), 146 deletions(-) diff --git a/projects/GKCore/GDModel/GDMAddress.cs b/projects/GKCore/GDModel/GDMAddress.cs index 892868b72..b595c8cea 100644 --- a/projects/GKCore/GDModel/GDMAddress.cs +++ b/projects/GKCore/GDModel/GDMAddress.cs @@ -245,16 +245,14 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddHash(fLines.GetHashCode()); - - hashCode.AddObj(fAddressLine1); - hashCode.AddObj(fAddressLine2); - hashCode.AddObj(fAddressLine3); - hashCode.AddObj(fAddressCity); - hashCode.AddObj(fAddressState); - hashCode.AddObj(fAddressPostalCode); - hashCode.AddObj(fAddressCountry); - + hashCode.Add(fLines); + hashCode.Add(fAddressLine1); + hashCode.Add(fAddressLine2); + hashCode.Add(fAddressLine3); + hashCode.Add(fAddressCity); + hashCode.Add(fAddressState); + hashCode.Add(fAddressPostalCode); + hashCode.Add(fAddressCountry); ProcessHashes(ref hashCode, fPhoneList); ProcessHashes(ref hashCode, fEmailList); ProcessHashes(ref hashCode, fFaxList); diff --git a/projects/GKCore/GDModel/GDMAssociation.cs b/projects/GKCore/GDModel/GDMAssociation.cs index 359df411e..621c0d02c 100644 --- a/projects/GKCore/GDModel/GDMAssociation.cs +++ b/projects/GKCore/GDModel/GDMAssociation.cs @@ -107,7 +107,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fRelation); + hashCode.Add(fRelation); ProcessHashes(ref hashCode, fSourceCitations); } diff --git a/projects/GKCore/GDModel/GDMChangeDate.cs b/projects/GKCore/GDModel/GDMChangeDate.cs index 74593606c..c1225ee5e 100644 --- a/projects/GKCore/GDModel/GDMChangeDate.cs +++ b/projects/GKCore/GDModel/GDMChangeDate.cs @@ -76,7 +76,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fChangeDateTime); + hashCode.Add(fChangeDateTime); } } } diff --git a/projects/GKCore/GDModel/GDMChildToFamilyLink.cs b/projects/GKCore/GDModel/GDMChildToFamilyLink.cs index c2184b310..b31a74ac4 100644 --- a/projects/GKCore/GDModel/GDMChildToFamilyLink.cs +++ b/projects/GKCore/GDModel/GDMChildToFamilyLink.cs @@ -87,8 +87,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fChildLinkageStatus); - hashCode.AddVal(fPedigreeLinkageType); + hashCode.Add(fChildLinkageStatus); + hashCode.Add(fPedigreeLinkageType); } } } diff --git a/projects/GKCore/GDModel/GDMCommunicationRecord.cs b/projects/GKCore/GDModel/GDMCommunicationRecord.cs index 97c958c52..62acdabb4 100644 --- a/projects/GKCore/GDModel/GDMCommunicationRecord.cs +++ b/projects/GKCore/GDModel/GDMCommunicationRecord.cs @@ -160,11 +160,11 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fCommName); - hashCode.AddVal(fCommunicationType); - hashCode.AddObj(fDate); - hashCode.AddVal(fCommDirection); - hashCode.AddObj(fCorresponder); + hashCode.Add(fCommName); + hashCode.Add(fCommunicationType); + hashCode.Add(fDate); + hashCode.Add(fCommDirection); + hashCode.Add(fCorresponder); } } } diff --git a/projects/GKCore/GDModel/GDMCustomEvent.cs b/projects/GKCore/GDModel/GDMCustomEvent.cs index 2caa7ebce..42f7abade 100644 --- a/projects/GKCore/GDModel/GDMCustomEvent.cs +++ b/projects/GKCore/GDModel/GDMCustomEvent.cs @@ -301,14 +301,14 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAddress); - hashCode.AddObj(fAgency); - hashCode.AddObj(fCause); - hashCode.AddObj(fClassification); - hashCode.AddObj(fDate); - hashCode.AddObj(fPlace); - hashCode.AddObj(fReligiousAffilation); - hashCode.AddVal(fRestriction); + hashCode.Add(fAddress); + hashCode.Add(fAgency); + hashCode.Add(fCause); + hashCode.Add(fClassification); + hashCode.Add(fDate); + hashCode.Add(fPlace); + hashCode.Add(fReligiousAffilation); + hashCode.Add(fRestriction); ProcessHashes(ref hashCode, fNotes); ProcessHashes(ref hashCode, fSourceCitations); ProcessHashes(ref hashCode, fMultimediaLinks); diff --git a/projects/GKCore/GDModel/GDMCutoutPosition.cs b/projects/GKCore/GDModel/GDMCutoutPosition.cs index ea240e049..0d5bf080f 100644 --- a/projects/GKCore/GDModel/GDMCutoutPosition.cs +++ b/projects/GKCore/GDModel/GDMCutoutPosition.cs @@ -131,10 +131,10 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fX1); - hashCode.AddVal(fY1); - hashCode.AddVal(fX2); - hashCode.AddVal(fY2); + hashCode.Add(fX1); + hashCode.Add(fY1); + hashCode.Add(fX2); + hashCode.Add(fY2); } } } diff --git a/projects/GKCore/GDModel/GDMDate.cs b/projects/GKCore/GDModel/GDMDate.cs index 9164530ee..f0103ab9d 100644 --- a/projects/GKCore/GDModel/GDMDate.cs +++ b/projects/GKCore/GDModel/GDMDate.cs @@ -703,13 +703,13 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fApproximated); - hashCode.AddVal(fCalendar); - hashCode.AddVal(fDay); - hashCode.AddVal(fMonth); - hashCode.AddVal(fYear); - hashCode.AddVal(fYearBC); - hashCode.AddObj(fYearModifier); + hashCode.Add(fApproximated); + hashCode.Add(fCalendar); + hashCode.Add(fDay); + hashCode.Add(fMonth); + hashCode.Add(fYear); + hashCode.Add(fYearBC); + hashCode.Add(fYearModifier); } } } diff --git a/projects/GKCore/GDModel/GDMDateInterpreted.cs b/projects/GKCore/GDModel/GDMDateInterpreted.cs index 2efe8deee..008aadfc3 100644 --- a/projects/GKCore/GDModel/GDMDateInterpreted.cs +++ b/projects/GKCore/GDModel/GDMDateInterpreted.cs @@ -81,7 +81,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDatePhrase); + hashCode.Add(fDatePhrase); } } } diff --git a/projects/GKCore/GDModel/GDMDatePeriod.cs b/projects/GKCore/GDModel/GDMDatePeriod.cs index 38391750d..70eefe2df 100644 --- a/projects/GKCore/GDModel/GDMDatePeriod.cs +++ b/projects/GKCore/GDModel/GDMDatePeriod.cs @@ -190,8 +190,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDateFrom); - hashCode.AddObj(fDateTo); + hashCode.Add(fDateFrom); + hashCode.Add(fDateTo); } } } diff --git a/projects/GKCore/GDModel/GDMDateRange.cs b/projects/GKCore/GDModel/GDMDateRange.cs index fc84bd34e..8d02e9871 100644 --- a/projects/GKCore/GDModel/GDMDateRange.cs +++ b/projects/GKCore/GDModel/GDMDateRange.cs @@ -202,8 +202,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDateAfter); - hashCode.AddObj(fDateBefore); + hashCode.Add(fDateAfter); + hashCode.Add(fDateBefore); } } } diff --git a/projects/GKCore/GDModel/GDMDateValue.cs b/projects/GKCore/GDModel/GDMDateValue.cs index b2351e084..ee049cab6 100644 --- a/projects/GKCore/GDModel/GDMDateValue.cs +++ b/projects/GKCore/GDModel/GDMDateValue.cs @@ -184,7 +184,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fValue); + hashCode.Add(fValue); } } } diff --git a/projects/GKCore/GDModel/GDMFamilyRecord.cs b/projects/GKCore/GDModel/GDMFamilyRecord.cs index d9e7712d8..ece41600f 100644 --- a/projects/GKCore/GDModel/GDMFamilyRecord.cs +++ b/projects/GKCore/GDModel/GDMFamilyRecord.cs @@ -311,9 +311,9 @@ protected override void ProcessHashes(ref HashCode hashCode) base.ProcessHashes(ref hashCode); ProcessHashes(ref hashCode, fChildren); - hashCode.AddObj(fHusband); - hashCode.AddObj(fWife); - hashCode.AddVal(fStatus); + hashCode.Add(fHusband); + hashCode.Add(fWife); + hashCode.Add(fStatus); } } } diff --git a/projects/GKCore/GDModel/GDMFileReference.cs b/projects/GKCore/GDModel/GDMFileReference.cs index f31b54a12..5f3e8c5a2 100644 --- a/projects/GKCore/GDModel/GDMFileReference.cs +++ b/projects/GKCore/GDModel/GDMFileReference.cs @@ -183,8 +183,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fMultimediaFormat); - hashCode.AddVal(fMediaType); + hashCode.Add(fMultimediaFormat); + hashCode.Add(fMediaType); } } } diff --git a/projects/GKCore/GDModel/GDMFileReferenceWithTitle.cs b/projects/GKCore/GDModel/GDMFileReferenceWithTitle.cs index b70e81bdf..fdc556e4a 100644 --- a/projects/GKCore/GDModel/GDMFileReferenceWithTitle.cs +++ b/projects/GKCore/GDModel/GDMFileReferenceWithTitle.cs @@ -59,7 +59,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fTitle); + hashCode.Add(fTitle); } } } diff --git a/projects/GKCore/GDModel/GDMGroupRecord.cs b/projects/GKCore/GDModel/GDMGroupRecord.cs index 3f3f61d61..468a92161 100644 --- a/projects/GKCore/GDModel/GDMGroupRecord.cs +++ b/projects/GKCore/GDModel/GDMGroupRecord.cs @@ -165,7 +165,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fGroupName); + hashCode.Add(fGroupName); ProcessHashes(ref hashCode, fMembers); } } diff --git a/projects/GKCore/GDModel/GDMIndividualRecord.cs b/projects/GKCore/GDModel/GDMIndividualRecord.cs index 48281f526..16e311995 100644 --- a/projects/GKCore/GDModel/GDMIndividualRecord.cs +++ b/projects/GKCore/GDModel/GDMIndividualRecord.cs @@ -575,7 +575,7 @@ protected override void ProcessHashes(ref HashCode hashCode) ProcessHashes(ref hashCode, fGroups); ProcessHashes(ref hashCode, fPersonalNames); ProcessHashes(ref hashCode, fSpouseToFamilyLinks); - hashCode.AddVal(fSex); + hashCode.Add(fSex); } } } diff --git a/projects/GKCore/GDModel/GDMLanguage.cs b/projects/GKCore/GDModel/GDMLanguage.cs index 43101dfbf..16e662285 100644 --- a/projects/GKCore/GDModel/GDMLanguage.cs +++ b/projects/GKCore/GDModel/GDMLanguage.cs @@ -188,7 +188,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fValue); + hashCode.Add(fValue); } } } diff --git a/projects/GKCore/GDModel/GDMLines.cs b/projects/GKCore/GDModel/GDMLines.cs index b76362d32..b97865ae3 100644 --- a/projects/GKCore/GDModel/GDMLines.cs +++ b/projects/GKCore/GDModel/GDMLines.cs @@ -74,7 +74,7 @@ public override int GetHashCode() var result = new HashCode(); for (int i = 0, num = base.Count; i < num; i++) { - result.AddObj(base[i]); + result.Add(base[i]); } return result.ToHashCode(); diff --git a/projects/GKCore/GDModel/GDMLocationLink.cs b/projects/GKCore/GDModel/GDMLocationLink.cs index 273488ef2..d4985a8d7 100644 --- a/projects/GKCore/GDModel/GDMLocationLink.cs +++ b/projects/GKCore/GDModel/GDMLocationLink.cs @@ -99,8 +99,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDate); - hashCode.AddVal(fRelationship); + hashCode.Add(fDate); + hashCode.Add(fRelationship); } } } diff --git a/projects/GKCore/GDModel/GDMLocationName.cs b/projects/GKCore/GDModel/GDMLocationName.cs index a46523647..d9dc39feb 100644 --- a/projects/GKCore/GDModel/GDMLocationName.cs +++ b/projects/GKCore/GDModel/GDMLocationName.cs @@ -108,9 +108,9 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAbbreviation); - hashCode.AddObj(fDate); - hashCode.AddVal(fLanguage); + hashCode.Add(fAbbreviation); + hashCode.Add(fDate); + hashCode.Add(fLanguage); } } } diff --git a/projects/GKCore/GDModel/GDMLocationRecord.cs b/projects/GKCore/GDModel/GDMLocationRecord.cs index 6dd8b74ca..84bc738f8 100644 --- a/projects/GKCore/GDModel/GDMLocationRecord.cs +++ b/projects/GKCore/GDModel/GDMLocationRecord.cs @@ -330,7 +330,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fMap); + hashCode.Add(fMap); ProcessHashes(ref hashCode, fNames); ProcessHashes(ref hashCode, fTopLevels); } diff --git a/projects/GKCore/GDModel/GDMLocationType.cs b/projects/GKCore/GDModel/GDMLocationType.cs index 2ed516f5a..2a46c4106 100644 --- a/projects/GKCore/GDModel/GDMLocationType.cs +++ b/projects/GKCore/GDModel/GDMLocationType.cs @@ -93,8 +93,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAbbreviation); - hashCode.AddObj(fDate); + hashCode.Add(fAbbreviation); + hashCode.Add(fDate); } } } diff --git a/projects/GKCore/GDModel/GDMMap.cs b/projects/GKCore/GDModel/GDMMap.cs index b8c4a27ad..dc48c0e23 100644 --- a/projects/GKCore/GDModel/GDMMap.cs +++ b/projects/GKCore/GDModel/GDMMap.cs @@ -76,8 +76,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fLati); - hashCode.AddVal(fLong); + hashCode.Add(fLati); + hashCode.Add(fLong); } } } diff --git a/projects/GKCore/GDModel/GDMMultimediaLink.cs b/projects/GKCore/GDModel/GDMMultimediaLink.cs index 2156a88c6..1e0f40e7e 100644 --- a/projects/GKCore/GDModel/GDMMultimediaLink.cs +++ b/projects/GKCore/GDModel/GDMMultimediaLink.cs @@ -169,11 +169,11 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fCutoutPosition); + hashCode.Add(fCutoutPosition); ProcessHashes(ref hashCode, fFileReferences); - hashCode.AddVal(fIsPrimary); - hashCode.AddVal(fIsPrimaryCutout); - hashCode.AddObj(fTitle); + hashCode.Add(fIsPrimary); + hashCode.Add(fIsPrimaryCutout); + hashCode.Add(fTitle); } } } diff --git a/projects/GKCore/GDModel/GDMNoteRecord.cs b/projects/GKCore/GDModel/GDMNoteRecord.cs index a9a62537b..a463157b8 100644 --- a/projects/GKCore/GDModel/GDMNoteRecord.cs +++ b/projects/GKCore/GDModel/GDMNoteRecord.cs @@ -136,7 +136,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fLines); + hashCode.Add(fLines); } } } diff --git a/projects/GKCore/GDModel/GDMNotes.cs b/projects/GKCore/GDModel/GDMNotes.cs index b05117796..6cc026ed6 100644 --- a/projects/GKCore/GDModel/GDMNotes.cs +++ b/projects/GKCore/GDModel/GDMNotes.cs @@ -88,7 +88,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fLines); + hashCode.Add(fLines); } } @@ -157,7 +157,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fLines); + hashCode.Add(fLines); } } } diff --git a/projects/GKCore/GDModel/GDMPersonalName.cs b/projects/GKCore/GDModel/GDMPersonalName.cs index 717485e15..842904b70 100644 --- a/projects/GKCore/GDModel/GDMPersonalName.cs +++ b/projects/GKCore/GDModel/GDMPersonalName.cs @@ -388,20 +388,20 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fGiven); - hashCode.AddVal(fLanguage); - hashCode.AddObj(fNamePrefix); - hashCode.AddObj(fNameSuffix); - hashCode.AddVal(fNameType); - hashCode.AddObj(fNickname); + hashCode.Add(fGiven); + hashCode.Add(fLanguage); + hashCode.Add(fNamePrefix); + hashCode.Add(fNameSuffix); + hashCode.Add(fNameType); + hashCode.Add(fNickname); ProcessHashes(ref hashCode, fNotes); ProcessHashes(ref hashCode, fSourceCitations); - hashCode.AddObj(fSurnamePrefix); - hashCode.AddObj(fSurname); - hashCode.AddObj(fPatronymicName); - hashCode.AddObj(fMarriedName); - hashCode.AddObj(fReligiousName); - hashCode.AddObj(fCensusName); + hashCode.Add(fSurnamePrefix); + hashCode.Add(fSurname); + hashCode.Add(fPatronymicName); + hashCode.Add(fMarriedName); + hashCode.Add(fReligiousName); + hashCode.Add(fCensusName); } } } diff --git a/projects/GKCore/GDModel/GDMPlace.cs b/projects/GKCore/GDModel/GDMPlace.cs index 07d531a01..ddaee6b38 100644 --- a/projects/GKCore/GDModel/GDMPlace.cs +++ b/projects/GKCore/GDModel/GDMPlace.cs @@ -136,9 +136,9 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fForm); - hashCode.AddObj(fLocation); - hashCode.AddObj(fMap); + hashCode.Add(fForm); + hashCode.Add(fLocation); + hashCode.Add(fMap); ProcessHashes(ref hashCode, fNotes); } } diff --git a/projects/GKCore/GDModel/GDMPointer.cs b/projects/GKCore/GDModel/GDMPointer.cs index f64275bde..30f1c8075 100644 --- a/projects/GKCore/GDModel/GDMPointer.cs +++ b/projects/GKCore/GDModel/GDMPointer.cs @@ -89,7 +89,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fXRef); + hashCode.Add(fXRef); } } } diff --git a/projects/GKCore/GDModel/GDMRecord.cs b/projects/GKCore/GDModel/GDMRecord.cs index 295d2fa03..2a069aad6 100644 --- a/projects/GKCore/GDModel/GDMRecord.cs +++ b/projects/GKCore/GDModel/GDMRecord.cs @@ -322,9 +322,9 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAutomatedRecordID); + hashCode.Add(fAutomatedRecordID); // without fChangeDate and fUID! - hashCode.AddObj(fXRef); + hashCode.Add(fXRef); ProcessHashes(ref hashCode, fMultimediaLinks); ProcessHashes(ref hashCode, fNotes); ProcessHashes(ref hashCode, fSourceCitations); diff --git a/projects/GKCore/GDModel/GDMRecordWithEvents.cs b/projects/GKCore/GDModel/GDMRecordWithEvents.cs index 99c2cc428..1f5aa0dd2 100644 --- a/projects/GKCore/GDModel/GDMRecordWithEvents.cs +++ b/projects/GKCore/GDModel/GDMRecordWithEvents.cs @@ -208,7 +208,7 @@ protected override void ProcessHashes(ref HashCode hashCode) base.ProcessHashes(ref hashCode); ProcessHashes(ref hashCode, fEvents); - hashCode.AddVal(fRestriction); + hashCode.Add(fRestriction); } } } diff --git a/projects/GKCore/GDModel/GDMRepositoryRecord.cs b/projects/GKCore/GDModel/GDMRepositoryRecord.cs index d47f4eef0..70d5dc73c 100644 --- a/projects/GKCore/GDModel/GDMRepositoryRecord.cs +++ b/projects/GKCore/GDModel/GDMRepositoryRecord.cs @@ -112,8 +112,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAddress); - hashCode.AddObj(fRepositoryName); + hashCode.Add(fAddress); + hashCode.Add(fRepositoryName); } } } diff --git a/projects/GKCore/GDModel/GDMResearchRecord.cs b/projects/GKCore/GDModel/GDMResearchRecord.cs index ce657fad2..d37c53cf6 100644 --- a/projects/GKCore/GDModel/GDMResearchRecord.cs +++ b/projects/GKCore/GDModel/GDMResearchRecord.cs @@ -316,12 +316,12 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fResearchName); - hashCode.AddVal(fPriority); - hashCode.AddVal(fStatus); - hashCode.AddObj(fStartDate); - hashCode.AddObj(fStopDate); - hashCode.AddVal(fPercent); + hashCode.Add(fResearchName); + hashCode.Add(fPriority); + hashCode.Add(fStatus); + hashCode.Add(fStartDate); + hashCode.Add(fStopDate); + hashCode.Add(fPercent); ProcessHashes(ref hashCode, fTasks); ProcessHashes(ref hashCode, fCommunications); ProcessHashes(ref hashCode, fGroups); diff --git a/projects/GKCore/GDModel/GDMSourceCitation.cs b/projects/GKCore/GDModel/GDMSourceCitation.cs index fe5d9757b..1a4855ecd 100644 --- a/projects/GKCore/GDModel/GDMSourceCitation.cs +++ b/projects/GKCore/GDModel/GDMSourceCitation.cs @@ -238,13 +238,13 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fCertaintyAssessment); - hashCode.AddObj(fData); - hashCode.AddObj(fPage); - hashCode.AddObj(fDescription); + hashCode.Add(fCertaintyAssessment); + hashCode.Add(fData); + hashCode.Add(fPage); + hashCode.Add(fDescription); ProcessHashes(ref hashCode, fMultimediaLinks); ProcessHashes(ref hashCode, fNotes); - hashCode.AddObj(fText); + hashCode.Add(fText); } } } diff --git a/projects/GKCore/GDModel/GDMSourceCitationData.cs b/projects/GKCore/GDModel/GDMSourceCitationData.cs index 17638d290..878d5ff57 100644 --- a/projects/GKCore/GDModel/GDMSourceCitationData.cs +++ b/projects/GKCore/GDModel/GDMSourceCitationData.cs @@ -93,8 +93,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDate); - hashCode.AddObj(fText); + hashCode.Add(fDate); + hashCode.Add(fText); } } } diff --git a/projects/GKCore/GDModel/GDMSourceData.cs b/projects/GKCore/GDModel/GDMSourceData.cs index 557b96df3..67482a523 100644 --- a/projects/GKCore/GDModel/GDMSourceData.cs +++ b/projects/GKCore/GDModel/GDMSourceData.cs @@ -107,7 +107,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAgency); + hashCode.Add(fAgency); ProcessHashes(ref hashCode, fEvents); ProcessHashes(ref hashCode, fNotes); } diff --git a/projects/GKCore/GDModel/GDMSourceEvent.cs b/projects/GKCore/GDModel/GDMSourceEvent.cs index d9e370dd1..476ff1ca2 100644 --- a/projects/GKCore/GDModel/GDMSourceEvent.cs +++ b/projects/GKCore/GDModel/GDMSourceEvent.cs @@ -90,8 +90,8 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fDate); - hashCode.AddObj(fPlace); + hashCode.Add(fDate); + hashCode.Add(fPlace); } } } diff --git a/projects/GKCore/GDModel/GDMSourceRecord.cs b/projects/GKCore/GDModel/GDMSourceRecord.cs index 44d4a8030..41a9a6c2b 100644 --- a/projects/GKCore/GDModel/GDMSourceRecord.cs +++ b/projects/GKCore/GDModel/GDMSourceRecord.cs @@ -284,14 +284,14 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fData); - hashCode.AddObj(fDate); - hashCode.AddObj(fOriginator); - hashCode.AddObj(fPublication); + hashCode.Add(fData); + hashCode.Add(fDate); + hashCode.Add(fOriginator); + hashCode.Add(fPublication); ProcessHashes(ref hashCode, fRepositoryCitations); - hashCode.AddObj(fShortTitle); - hashCode.AddObj(fText); - hashCode.AddObj(fTitle); + hashCode.Add(fShortTitle); + hashCode.Add(fText); + hashCode.Add(fTitle); } } } diff --git a/projects/GKCore/GDModel/GDMSubmissionRecord.cs b/projects/GKCore/GDModel/GDMSubmissionRecord.cs index fb42cb0e1..ad5362f72 100644 --- a/projects/GKCore/GDModel/GDMSubmissionRecord.cs +++ b/projects/GKCore/GDModel/GDMSubmissionRecord.cs @@ -125,12 +125,12 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fFamilyFileName); - hashCode.AddObj(fTempleCode); - hashCode.AddVal(fGenerationsOfAncestors); - hashCode.AddVal(fGenerationsOfDescendants); - hashCode.AddVal(fOrdinanceProcessFlag); - hashCode.AddObj(fSubmitter); + hashCode.Add(fFamilyFileName); + hashCode.Add(fTempleCode); + hashCode.Add(fGenerationsOfAncestors); + hashCode.Add(fGenerationsOfDescendants); + hashCode.Add(fOrdinanceProcessFlag); + hashCode.Add(fSubmitter); } } } diff --git a/projects/GKCore/GDModel/GDMSubmitterRecord.cs b/projects/GKCore/GDModel/GDMSubmitterRecord.cs index 54998c11a..ff0e18a13 100644 --- a/projects/GKCore/GDModel/GDMSubmitterRecord.cs +++ b/projects/GKCore/GDModel/GDMSubmitterRecord.cs @@ -124,10 +124,10 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fAddress); + hashCode.Add(fAddress); ProcessHashes(ref hashCode, fLanguages); - hashCode.AddObj(fName); - hashCode.AddObj(fRegisteredReference); + hashCode.Add(fName); + hashCode.Add(fRegisteredReference); } } } diff --git a/projects/GKCore/GDModel/GDMTag.cs b/projects/GKCore/GDModel/GDMTag.cs index edf1552dd..cd961b647 100644 --- a/projects/GKCore/GDModel/GDMTag.cs +++ b/projects/GKCore/GDModel/GDMTag.cs @@ -296,7 +296,7 @@ protected static void ProcessHashes(ref HashCode hashCode, GDMList tags) w protected virtual void ProcessHashes(ref HashCode hashCode) { - hashCode.AddVal(fId); + hashCode.Add(fId); ProcessHashes(ref hashCode, fTags); } @@ -354,7 +354,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fStringValue); + hashCode.Add(fStringValue); } } } diff --git a/projects/GKCore/GDModel/GDMTaskRecord.cs b/projects/GKCore/GDModel/GDMTaskRecord.cs index 6aa6d3a12..a553125af 100644 --- a/projects/GKCore/GDModel/GDMTaskRecord.cs +++ b/projects/GKCore/GDModel/GDMTaskRecord.cs @@ -125,10 +125,10 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fGoal); - hashCode.AddVal(fPriority); - hashCode.AddObj(fStartDate); - hashCode.AddObj(fStopDate); + hashCode.Add(fGoal); + hashCode.Add(fPriority); + hashCode.Add(fStartDate); + hashCode.Add(fStopDate); } } } diff --git a/projects/GKCore/GDModel/GDMTime.cs b/projects/GKCore/GDModel/GDMTime.cs index 0fffe8cdb..91b0155b0 100644 --- a/projects/GKCore/GDModel/GDMTime.cs +++ b/projects/GKCore/GDModel/GDMTime.cs @@ -120,10 +120,10 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddVal(fHour); - hashCode.AddVal(fMinutes); - hashCode.AddVal(fSeconds); - hashCode.AddVal(fFraction); + hashCode.Add(fHour); + hashCode.Add(fMinutes); + hashCode.Add(fSeconds); + hashCode.Add(fFraction); } } } diff --git a/projects/GKCore/GDModel/GDMUserReference.cs b/projects/GKCore/GDModel/GDMUserReference.cs index 57dc5a379..7c4a9790f 100644 --- a/projects/GKCore/GDModel/GDMUserReference.cs +++ b/projects/GKCore/GDModel/GDMUserReference.cs @@ -65,7 +65,7 @@ protected override void ProcessHashes(ref HashCode hashCode) { base.ProcessHashes(ref hashCode); - hashCode.AddObj(fReferenceType); + hashCode.Add(fReferenceType); } } } diff --git a/projects/GKCore/GKCore/HashCode.cs b/projects/GKCore/GKCore/HashCode.cs index d1cfe818d..0fbb22c75 100644 --- a/projects/GKCore/GKCore/HashCode.cs +++ b/projects/GKCore/GKCore/HashCode.cs @@ -129,18 +129,10 @@ private static uint MixFinal(uint hash) #endregion - public void AddVal(T value) where T : struct + public void Add(T value) { - AddHash(value.GetHashCode()); - } + int hashCode = value?.GetHashCode() ?? 0; - public void AddObj(T value) where T : class - { - AddHash(value == null ? 0 : value.GetHashCode()); - } - - public void AddHash(int value) - { // The original xxHash works as follows: // 0. Initialize immediately. We can't do this in a struct (no // default ctor). @@ -162,7 +154,7 @@ public void AddHash(int value) // To see what's really going on here, have a look at the Combine // methods. - uint val = unchecked((uint)value); + uint val = unchecked((uint)hashCode); // Storing the value of _length locally shaves of quite a few bytes // in the resulting machine code.