From d9911f64b9b0f8dad684eae0fbd90ca315d559f7 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 22 Jan 2025 21:31:07 -0600 Subject: [PATCH] Simplify Full data hash logic to speed up saving --- .../distanthorizons/core/sql/dto/FullDataSourceV2DTO.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java index c469da853..15abd48e5 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/dto/FullDataSourceV2DTO.java @@ -97,7 +97,9 @@ public class FullDataSourceV2DTO // populate individual variables { dto.pos = dataSource.getPos(); - dto.dataChecksum = (dataSource.mapping.hashCode() * 4217) + dataSource.hashCode(); + // the mapping hash isn't included since it takes significantly longer to calculate and + // as of the time of this comment (2025-1-22) the checksum isn't used for anything so changing it shouldn't cause any issues + dto.dataChecksum = dataSource.hashCode(); dto.dataFormatVersion = FullDataSourceV2.DATA_FORMAT_VERSION; dto.compressionModeValue = compressionModeEnum.value; dto.lastModifiedUnixDateTime = dataSource.lastModifiedUnixDateTime;