Skip to content

Commit 39c32da

Browse files
authored
all: fix some comments (#161)
fix some comments Signed-off-by: cuishuang <imcusg@gmail.com>
1 parent 16367f2 commit 39c32da

15 files changed

+19
-19
lines changed

s2/builder_snapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func (sf CellIDSnapper) SnapPoint(point Point) Point {
348348
}
349349

350350
const (
351-
// The minum exponent supported for snapping.
351+
// The minimum exponent supported for snapping.
352352
minIntSnappingExponent = 0
353353
// The maximum exponent supported for snapping.
354354
maxIntSnappingExponent = 10

s2/cell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (c Cell) VertexRaw(k int) Point {
124124
return Point{faceUVToXYZ(int(c.face), c.uv.Vertices()[k].X, c.uv.Vertices()[k].Y)}
125125
}
126126

127-
// Edge returns the nomalized inward-facing normal of the great circle passing through
127+
// Edge returns the normalized inward-facing normal of the great circle passing through
128128
// the CCW ordered edge from vertex k to vertex k+1 (mod 4) (for k = 0,1,2,3)
129129
func (c Cell) Edge(k int) Point {
130130
return Point{c.EdgeRaw(k).Normalize()}

s2/edge_crossings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func intersectionStableSorted(a0, a1, b0, b1 Point) (Point, bool) {
367367
// is not guaranteed to have the correct sign (i.e., the return value may need
368368
// to be negated).
369369
func intersectionExact(a0, a1, b0, b1 Point) Point {
370-
// Since we are using presice arithmetic, we don't need to worry about
370+
// Since we are using precise arithmetic, we don't need to worry about
371371
// numerical stability.
372372
a0P := r3.PreciseVectorFromVector(a0.Vector)
373373
a1P := r3.PreciseVectorFromVector(a1.Vector)

s2/lexicon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (l *sequenceLexicon) size() int {
149149
return len(l.begins) - 1
150150
}
151151

152-
// hash returns a hash of this sequence of int32s.
152+
// hashSet returns a hash of this sequence of int32s.
153153
func hashSet(s []int32) uint32 {
154154
// TODO(roberts): We just need a way to nicely hash all the values down to
155155
// a 32-bit value. To ensure no unnecessary dependencies we use the core

s2/pointcompression.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func stToPiQi(s float64, level uint) uint32 {
300300
return uint32(s * float64(int(1)<<level))
301301
}
302302

303-
// siTiToPiQi returns the value transformed into the PiQi coordinate spade.
303+
// siTitoPiQi returns the value transformed into the PiQi coordinate spade.
304304
// encodeFirstPointFixedLength encodes the return value using level bits,
305305
// so we clamp si to the range [0, 2**level - 1] before trying to encode
306306
// it. This is okay because if si == maxSiTi, then it is not a cell center

s2/polyline_alignment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ type columnStride struct {
9797
end int
9898
}
9999

100-
// inRange reports if the given index is in range of this stride.
100+
// InRange reports if the given index is in range of this stride.
101101
func (c columnStride) InRange(index int) bool {
102102
return c.start <= index && index < c.end
103103
}
@@ -235,7 +235,7 @@ func (w *window) checkedColumnStride(row int) columnStride {
235235
return w.strides[row]
236236
}
237237

238-
// upscale returns a new, larger window that is an upscaled version of this window.
238+
// upsample returns a new, larger window that is an upscaled version of this window.
239239
//
240240
// Used by ApproximateAlignment window expansion step.
241241
func (w *window) upsample(newRows, newCols int) *window {
@@ -402,7 +402,7 @@ func ExactVertexAlignmentCost(a, b *Polyline) float64 {
402402
return cost[len(cost)-1]
403403
}
404404

405-
// GetExactVertexAlignment takes two non-empty polylines as input, and returns
405+
// ExactVertexAlignment takes two non-empty polylines as input, and returns
406406
// the VertexAlignment corresponding to the optimal alignment between them. This
407407
// method is quadratic O(A*B) in both space and time complexity.
408408
func ExactVertexAlignment(a, b *Polyline) *vertexAlignment {

s2/polyline_alignment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,4 +448,4 @@ func TestPolylineAlignmentExactAlignmentCost(t *testing.T) {
448448

449449
// TODO()rsned): Differences from C++
450450
// Medoid tests
451-
// Consensus testss
451+
// Consensus tests

s2/polyline_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestPolylineBasics(t *testing.T) {
3333
}
3434
empty.Reverse()
3535
if len(empty) != 0 {
36-
t.Errorf("reveresed empty Polyline should have no vertices")
36+
t.Errorf("reversed empty Polyline should have no vertices")
3737
}
3838

3939
latlngs := []LatLng{

s2/predicates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func precSub(a, b *big.Float) *big.Float {
123123
return new(big.Float).SetPrec(big.MaxPrec).Sub(a, b)
124124
}
125125

126-
// precSub is a helper to wrap the boilerplate of multiplying two big.Floats.
126+
// precMul is a helper to wrap the boilerplate of multiplying two big.Floats.
127127
func precMul(a, b *big.Float) *big.Float {
128128
return new(big.Float).SetPrec(big.MaxPrec).Mul(a, b)
129129
}

s2/predicates_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ func testCompareDistancesConsistency(t *testing.T, x, a, b Point, distFunc compa
886886
}
887887

888888
// choosePointNearPlaneOrAxes returns a random Point that is often near the
889-
// intersection of one of the coodinates planes or coordinate axes with the unit
889+
// intersection of one of the coordinates planes or coordinate axes with the unit
890890
// sphere. (It is possible to represent very small perturbations near such points.)
891891
func choosePointNearPlaneOrAxes() Point {
892892
p := randomPoint()
@@ -1042,7 +1042,7 @@ func TestPredicatesSignDotProd(t *testing.T) {
10421042
for _, test := range tests {
10431043
got := SignDotProd(test.a, test.b)
10441044
if got != test.want {
1045-
t.Errorf("SignDotProd(%+v, %+v) = %d, wnat %d", test.a, test.b, got, test.want)
1045+
t.Errorf("SignDotProd(%+v, %+v) = %d, want %d", test.a, test.b, got, test.want)
10461046
}
10471047

10481048
gotPrec := "EXACT"

0 commit comments

Comments
 (0)