Skip to content

Commit

Permalink
vector: expose (*Path).Reset
Browse files Browse the repository at this point in the history
Closes #3123
  • Loading branch information
hajimehoshi committed Oct 5, 2024
1 parent d8642d3 commit 62978ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vector/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ type subpath struct {
closed bool
}

// reset resets the subpath.
// reset doesn't release the allocated memory so that the memory can be reused.
func (s *subpath) reset() {
// Reset resets the subpath.
// Reset doesn't release the allocated memory so that the memory can be reused.
func (s *subpath) Reset() {
s.points = s.points[:0]
s.closed = false
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func (p *Path) appendNewSubpath(pt point) {
if cap(p.subpaths) > len(p.subpaths) {
// Reuse the last subpath since the last subpath might have an already allocated slice.
p.subpaths = p.subpaths[:len(p.subpaths)+1]
p.subpaths[len(p.subpaths)-1].reset()
p.subpaths[len(p.subpaths)-1].Reset()
p.subpaths[len(p.subpaths)-1].appendPoint(pt)
return
}
Expand Down

0 comments on commit 62978ea

Please sign in to comment.