Skip to content

Commit

Permalink
Removed unneded null check.
Browse files Browse the repository at this point in the history
  • Loading branch information
alelom authored and pawelbaran committed Apr 13, 2023
1 parent de5a524 commit 201f54d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Revit_Engine/Compute/RevitDiffing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ private static Diff Diffing(IEnumerable<object> pastObjects, IEnumerable<object>
{
rcc = new RevitComparisonConfig();

if (diffConfig != null)
BH.Engine.Reflection.Modify.CopyPropertiesFromParent(rcc, diffConfig?.ComparisonConfig);
BH.Engine.Reflection.Modify.CopyPropertiesFromParent(rcc, diffConfig?.ComparisonConfig);
}

// Get the past and following RevitIdentifiers fragments.
Expand Down Expand Up @@ -183,7 +182,7 @@ private static Diff Diffing(IEnumerable<object> pastObjects, IEnumerable<object>
followingIds = followingIdFragments.Select(x => x.PersistentId.ToString()).ToList();
}

//Check for duplicate ids
//Check for duplicate ids
bool dupsInPastIds = pastIds.Count != pastIds.Distinct().Count();
bool dupsInFollIds = followingIds.Count != followingIds.Distinct().Count();

Expand All @@ -194,7 +193,7 @@ private static Diff Diffing(IEnumerable<object> pastObjects, IEnumerable<object>
if (dupsInFollIds) messageSubjects.Add(nameof(followingObjects));
string message = $"Some of the {string.Join(" and ", messageSubjects)} contain duplicate {revitIdName}s. ";

if((dupsInPastIds && pastObjects.Any(x => x.GetType().Namespace.Contains("Structure"))) ||
if ((dupsInPastIds && pastObjects.Any(x => x.GetType().Namespace.Contains("Structure"))) ||
(dupsInFollIds && followingObjects.Any(x => x.GetType().Namespace.Contains("Structure"))))
message += "\nIf trying to diff structural objects, try pulling using the Phsyical discipline rather than Structural discipline, as models containing disjointed floors and walls and/or curved beams lead to one Revit element being converted into multiple structural BHoM elements.";

Expand Down

0 comments on commit 201f54d

Please sign in to comment.