simplifyRegionType MethodStatic

Simplify the type of the region by stripping redundant parent(s).

  • No Boolean operations are performed.
  • Invalid inputs (such as childless regions) are not corrected.

simplifyRegionType(region: AnyRegion): AnyRegion

@returns * For a UnionRegion with exactly one child, return it if it is a Loop, or if it is a ParityRegion with multiple children, otherwise return the ParityRegion's Loop.

  • For a ParityRegion with exactly one Loop, return it.
  • All other inputs returned unchanged.
Parameter Type Description
region AnyRegion region to simplify

Returns - AnyRegion

  • For a UnionRegion with exactly one child, return it if it is a Loop, or if it is a ParityRegion with multiple children, otherwise return the ParityRegion's Loop.
  • For a ParityRegion with exactly one Loop, return it.
  • All other inputs returned unchanged.

Defined in

Last Updated: 24 June, 2025