# `GSPath cleanUp`

*Instance Method*

Removes redundant nodes and rounds node positions to the layer grid.

## Declaration

```swift
func cleanUp()
```

```objc
- (void) cleanUp;
```

```python
cleanUp()
```

## Discussion

Cleanup removes nodes that do not affect the path shape within the cleanup tolerance. It also closes an open path when its endpoints are nearly coincident.

## See Also

### Cleanup

- [`GSPath cleanUpGrid:`](/Core/GlyphsCore/GSPath/cleanUpGrid:) — Removes redundant nodes and rounds node positions to a grid.
- [`GSPath findRequiredNodeIndexes:grid:`](/Core/GlyphsCore/GSPath/findRequiredNodeIndexes:grid:) — Adds the node indices that cleanup would keep.
- [`GSPath removeDuplicateNodes`](/Core/GlyphsCore/GSPath/removeDuplicateNodes) — Removes adjacent on-curve nodes at the same position.

