Skip to content

Commit

Permalink
Remove explicit initialisation of label fields
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed Nov 8, 2022
1 parent 1b26f41 commit 712b6ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
19 changes: 2 additions & 17 deletions geom/dcel.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ func (d *doublyConnectedEdgeList) addMultiPolygon(mp MultiPolygon, operand opera
vr := &vertexRecord{
coords: xy,
incidents: nil, // populated later
src: [2]bool{},
inSet: [2]bool{},
locations: newLocationsOnBoundary(operand),
}
vr.src[operand] = true
Expand All @@ -149,8 +147,6 @@ func (d *doublyConnectedEdgeList) addMultiPolygon(mp MultiPolygon, operand opera
next: nil, // populated later
prev: nil, // populated later
seq: segment,
srcEdge: [2]bool{},
srcFace: [2]bool{},
}
externalEdge := &halfEdgeRecord{
origin: vertB,
Expand All @@ -159,8 +155,6 @@ func (d *doublyConnectedEdgeList) addMultiPolygon(mp MultiPolygon, operand opera
next: nil, // populated later
prev: nil, // populated later
seq: reverseSegment,
srcEdge: [2]bool{},
srcFace: [2]bool{},
}
internalEdge.srcEdge[operand] = true
internalEdge.srcFace[operand] = true
Expand Down Expand Up @@ -206,11 +200,7 @@ func (d *doublyConnectedEdgeList) addMultiLineString(mls MultiLineString, operan
}
vr := &vertexRecord{
coords: xy,
incidents: nil, // populated later
src: [2]bool{},
inSet: [2]bool{},
locations: locs,
extracted: false,
}
vr.src[operand] = true
d.vertices[xy] = vr
Expand Down Expand Up @@ -259,9 +249,6 @@ func (d *doublyConnectedEdgeList) addMultiLineString(mls MultiLineString, operan
next: nil, // set later
prev: nil, // set later
seq: segment,
srcEdge: [2]bool{},
srcFace: [2]bool{},
inSet: [2]bool{},
}
rev := &halfEdgeRecord{
origin: vDestin,
Expand Down Expand Up @@ -297,8 +284,6 @@ func (d *doublyConnectedEdgeList) addMultiPoint(mp MultiPoint, operand operand)
record = &vertexRecord{
coords: xy,
incidents: nil,
src: [2]bool{},
inSet: [2]bool{},
locations: [2]location{}, // set below
}
d.vertices[xy] = record
Expand Down Expand Up @@ -329,10 +314,10 @@ func (d *doublyConnectedEdgeList) addGhosts(mls MultiLineString, operand operand
endXY := reverseSegment.GetXY(0)

if _, ok := d.vertices[startXY]; !ok {
d.vertices[startXY] = &vertexRecord{coords: startXY, incidents: nil}
d.vertices[startXY] = &vertexRecord{coords: startXY}
}
if _, ok := d.vertices[endXY]; !ok {
d.vertices[endXY] = &vertexRecord{coords: endXY, incidents: nil}
d.vertices[endXY] = &vertexRecord{coords: endXY}
}

if edges.containsStartIntermediateEnd(segment) {
Expand Down
1 change: 0 additions & 1 deletion geom/dcel_overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func (d *doublyConnectedEdgeList) reAssignFaces() {
for _, cycle := range cycles {
f := &faceRecord{
cycle: cycle,
inSet: [2]bool{}, // populated below
}
d.faces = append(d.faces, f)
forEachEdge(cycle, func(e *halfEdgeRecord) {
Expand Down

0 comments on commit 712b6ff

Please sign in to comment.