From c8dadd106cdcdabcd9473df8d6c3f813c8b677ce Mon Sep 17 00:00:00 2001 From: Chomp Date: Sun, 9 Feb 2025 19:14:48 +0000 Subject: [PATCH] Interned more strings --- Libraries/Core/Models/Eft/Common/LocationBase.cs | 12 ++++++++++-- Libraries/Core/Models/Eft/Common/LooseLoot.cs | 11 +++++++++-- Libraries/Core/Models/Eft/Common/Tables/Item.cs | 12 ++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Libraries/Core/Models/Eft/Common/LocationBase.cs b/Libraries/Core/Models/Eft/Common/LocationBase.cs index 919f983f..561853a3 100644 --- a/Libraries/Core/Models/Eft/Common/LocationBase.cs +++ b/Libraries/Core/Models/Eft/Common/LocationBase.cs @@ -1519,11 +1519,19 @@ public record SpawnPointParam public record ColliderParams { + private string? _parent; + [JsonPropertyName("_parent")] public string? Parent { - get; - set; + get + { + return _parent; + } + set + { + _parent = string.Intern(value); + } } [JsonPropertyName("_props")] diff --git a/Libraries/Core/Models/Eft/Common/LooseLoot.cs b/Libraries/Core/Models/Eft/Common/LooseLoot.cs index 7b5482f6..8d1ed372 100644 --- a/Libraries/Core/Models/Eft/Common/LooseLoot.cs +++ b/Libraries/Core/Models/Eft/Common/LooseLoot.cs @@ -221,10 +221,17 @@ public record LooseLootItemDistribution public record ComposedKey { + private string? _key; [JsonPropertyName("key")] public string? Key { - get; - set; + get + { + return _key; + } + set + { + _key = string.Intern(value); + } } } diff --git a/Libraries/Core/Models/Eft/Common/Tables/Item.cs b/Libraries/Core/Models/Eft/Common/Tables/Item.cs index 06ce1a95..d8772a05 100644 --- a/Libraries/Core/Models/Eft/Common/Tables/Item.cs +++ b/Libraries/Core/Models/Eft/Common/Tables/Item.cs @@ -5,6 +5,8 @@ namespace Core.Models.Eft.Common.Tables; public record Item { + private string? _id; + private string? _parentId; private string? _SlotId; @@ -15,8 +17,14 @@ public record Item [JsonPropertyName("_id")] public string? Id { - get; - set; + get + { + return _id; + } + set + { + _id = string.Intern(value); + } } [JsonPropertyName("_tpl")]