Примеры ошибок, обнаруженных с помощью диагностики V3078
V3078. Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting.
SharpDevelop
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. CodeCoverageMethodElement.cs 124
void Init()
{
....
this.SequencePoints.OrderBy(item => item.Line)
.OrderBy(item => item.Column);
}
Telerik UI for UWP
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. GridModel.Selection.cs 107
private void BuildCellSelectionRegions(....)
{
....
this.MergeCellSelectionRegions(selectedItemsInView
.OrderBy(c => c.Column.ItemInfo.LayoutInfo.Line)
.OrderBy(c => c.RowItemInfo.LayoutInfo.Line));
}
Ryujinx
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. ShaderConfig.cs 413
private static TextureDescriptor[] GetTextureOrImageDescriptors(....)
{
....
foreach (var kv in dict.OrderBy(x => x.Key.Indexed)
.OrderBy(x => x.Key.Handle))
{
....
}
....
}
Unity C# reference source code
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. UnityEditor MenuService.cs 499
private List<T> GetChildrenRecursively(bool sorted = false,
List<T> result = null)
{
....
var children = sorted ?
(IEnumerable<MenuItemsTree<T>>)m_Children.OrderBy(c => c.key)
.OrderBy(c => c.m_Priority)
: m_Children;
....
}
Unity C# reference source code
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. UnityEditor SearchSelector.cs 177
internal static void RefreshSelectors()
{
....
selectors = ReflectionUtils.LoadAllMethodsWithAttribute(....)
.Where(s => s.valid)
.OrderBy(s => s.priority)
.OrderBy(s => string.IsNullOrEmpty(s.provider))
.ToList();
}
GrandNode
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. Grand.Infrastructure MigrationManager.cs 40
public IEnumerable<IMigration> GetCurrentMigrations()
{
var currentDbVersion
= new DbVersion(int.Parse(GrandVersion.MajorVersion),
int.Parse(GrandVersion.MinorVersion));
return GetAllMigrations()
.Where(x => currentDbVersion.CompareTo(x.Version) >= 0)
.OrderBy(mg => mg.Version.ToString())
.OrderBy(mg => mg.Priority)
.ToList();
}
IL2CPU
V3078 Original sorting order will be lost after repetitive call to 'OrderByDescending' method. Use 'ThenByDescending' method to preserve the original sorting. Cosmos.IL2CPU CompilerEngine.cs 462
private void LoadBootEntries()
{
....
mBootEntries = mBootEntries.OrderBy(e => e.Value)
.OrderByDescending(e => e.Value.HasValue)
.ToDictionary(e => e.Key, e => e.Value);
....
}
Unity C# reference source code
V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. MenuService.cs 499
private List<T> GetChildrenRecursively(....)
{
if (result == null)
result = new List<T>();
if (m_Children.Any())
{
var children = sorted ? (....)m_Children.OrderBy(c => c.key)
.OrderBy(c => c.m_Priority)
: m_Children;
foreach (var child in children)
child.GetChildrenRecursively(sorted, result);
}
else if (value != null)
result.Add(value);
return result;
}
Similar errors can be found in some other places:
- V3078 Original sorting order will be lost after repetitive call to 'OrderBy' method. Use 'ThenBy' method to preserve the original sorting. SearchSelector.cs 177