Cleans up some code, adds code comments
This commit is contained in:
@@ -9,6 +9,9 @@ using System.Text;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Serializes/Deserializes <see cref="ContentNestedData"/> document to the SQL Database as bytes using MessagePack
|
||||
/// </summary>
|
||||
internal class MsgPackContentNestedDataSerializer : IContentNestedDataByteSerializer
|
||||
{
|
||||
private MessagePackSerializerOptions _options;
|
||||
@@ -65,7 +68,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
/// <param name="nestedData"></param>
|
||||
private void Optimize(ContentNestedData nestedData)
|
||||
{
|
||||
if (_propertyOptions.PropertyMap != null && _propertyOptions.PropertyMap.Any())
|
||||
if (_propertyOptions.PropertyMap != null && _propertyOptions.PropertyMap.Count > 0)
|
||||
{
|
||||
foreach (var map in _propertyOptions.PropertyMap)
|
||||
{
|
||||
@@ -79,10 +82,13 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if there is an alias map for this property then use that instead of the real property alias
|
||||
// (used to save memory, the mapped alias is normally a single char or at least a smaller string)
|
||||
if (map.Value.MappedAlias != null && !map.Key.Equals(map.Value.MappedAlias)
|
||||
&& nestedData.PropertyData.Remove(map.Key) && nestedData.PropertyData.TryGetValue(map.Key, out PropertyData[] properties2))
|
||||
&& nestedData.PropertyData.Remove(map.Key)
|
||||
&& nestedData.PropertyData.TryGetValue(map.Key, out PropertyData[] properties2))
|
||||
{
|
||||
nestedData.PropertyData.Remove(map.Key);
|
||||
nestedData.PropertyData.Add(map.Value.MappedAlias, properties2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user