Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Apr 19, 2017
1 parent ad4a83d commit c1c4c80
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -71,26 +71,27 @@ private PropertyExistenceEnforcer( List<LabelSchemaDescriptor> nodes, List<Relat
this.relationshipConstraints = rels;
for ( LabelSchemaDescriptor constraint : nodes )
{
update( mandatoryNodePropertiesByLabel, constraint.getLabelId(), copyIds( constraint.getPropertyIds() ) );
update( mandatoryNodePropertiesByLabel, constraint.getLabelId(),
copyAndSortPropertyIds( constraint.getPropertyIds() ) );
}
for ( RelationTypeSchemaDescriptor constraint : rels )
{
update( mandatoryRelationshipPropertiesByType, constraint.getRelTypeId(),
copyIds( constraint.getPropertyIds() ) );
copyAndSortPropertyIds( constraint.getPropertyIds() ) );
}
}

private static void update( PrimitiveIntObjectMap<int[]> map, int key, int[] values )
private static void update( PrimitiveIntObjectMap<int[]> map, int key, int[] sortedValues )
{
int[] current = map.get( key );
if ( current != null )
{
values = union( current, values );
sortedValues = union( current, sortedValues );
}
map.put( key, values );
map.put( key, sortedValues );
}

private static int[] copyIds( int[] propertyIds )
private static int[] copyAndSortPropertyIds( int[] propertyIds )
{
int[] values = new int[propertyIds.length];
System.arraycopy( propertyIds, 0, values, 0, propertyIds.length );
Expand Down

0 comments on commit c1c4c80

Please sign in to comment.