Skip to content

Commit

Permalink
pcp: Eliminate some redundant pointer validity checking in _ScanArcs().
Browse files Browse the repository at this point in the history
(Internal change: 2305555)
  • Loading branch information
gitamohr authored and pixar-oss committed Nov 17, 2023
1 parent 5416d66 commit 005d75e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pxr/usd/pcp/primIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,22 +664,23 @@ _ScanArcs(PcpNodeRef const& node)
size_t arcs = 0;
SdfPath const& path = node.GetPath();
for (SdfLayerRefPtr const& layer: node.GetLayerStack()->GetLayers()) {
if (!layer->HasSpec(path)) {
SdfLayer const *layerPtr = get_pointer(layer);
if (!layerPtr->HasSpec(path)) {
continue;
}
if (layer->HasField(path, SdfFieldKeys->InheritPaths)) {
if (layerPtr->HasField(path, SdfFieldKeys->InheritPaths)) {
arcs |= _ArcFlagInherits;
}
if (layer->HasField(path, SdfFieldKeys->VariantSetNames)) {
if (layerPtr->HasField(path, SdfFieldKeys->VariantSetNames)) {
arcs |= _ArcFlagVariants;
}
if (layer->HasField(path, SdfFieldKeys->References)) {
if (layerPtr->HasField(path, SdfFieldKeys->References)) {
arcs |= _ArcFlagReferences;
}
if (layer->HasField(path, SdfFieldKeys->Payload)) {
if (layerPtr->HasField(path, SdfFieldKeys->Payload)) {
arcs |= _ArcFlagPayloads;
}
if (layer->HasField(path, SdfFieldKeys->Specializes)) {
if (layerPtr->HasField(path, SdfFieldKeys->Specializes)) {
arcs |= _ArcFlagSpecializes;
}
}
Expand Down

0 comments on commit 005d75e

Please sign in to comment.