Interns strings for aliases, etc... for when content is deserialized from the contentNu table so we aren't duplicating strings when cold booting.
This commit is contained in:
@@ -23,13 +23,15 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
return read(stream);
|
||||
}
|
||||
|
||||
protected string ReadStringObject(Stream stream) // required 'cos string is not a struct
|
||||
protected string ReadStringObject(Stream stream, bool intern = false) // required 'cos string is not a struct
|
||||
{
|
||||
var type = PrimitiveSerializer.Char.ReadFrom(stream);
|
||||
if (type == 'N') return null;
|
||||
if (type != 'S')
|
||||
throw new NotSupportedException($"Cannot deserialize type '{type}', expected 'S'.");
|
||||
return PrimitiveSerializer.String.ReadFrom(stream);
|
||||
return intern
|
||||
? string.Intern(PrimitiveSerializer.String.ReadFrom(stream))
|
||||
: PrimitiveSerializer.String.ReadFrom(stream);
|
||||
}
|
||||
|
||||
protected int? ReadIntObject(Stream stream) => ReadObject(stream, 'I', ReadInt);
|
||||
|
||||
Reference in New Issue
Block a user