Skip to content

Commit 0809177

Browse files
committed
interface{} -> any
1 parent 11fc526 commit 0809177

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

benchmarks/indexes_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
type discardLogger struct{}
1818

19-
func (discardLogger) Println(...interface{}) {}
19+
func (discardLogger) Println(...any) {}
2020

2121
func Benchmark_Indexes(b *testing.B) {
2222
storeWithoutIndexes := namespace.CreateNamespace[*User]()

examples/custom-field-time/types/comparators/time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ func (fc TimeFieldComparator[R]) ValuesCount() int {
4848
return len(fc.Value)
4949
}
5050

51-
func (fc TimeFieldComparator[R]) ValueAt(index int) interface{} {
51+
func (fc TimeFieldComparator[R]) ValueAt(index int) any {
5252
return fc.Value[index]
5353
}

examples/custom-field-time/types/indexes/time.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (idx timeIndexComputation[R]) ForRecord(item R) indexes.Key {
2525
}
2626
}
2727

28-
func (idx timeIndexComputation[R]) ForValue(item interface{}) indexes.Key {
28+
func (idx timeIndexComputation[R]) ForValue(item any) indexes.Key {
2929
return compute.ComparableKey[int64]{
3030
Value: item.(time.Time).UnixNano(),
3131
}

indexes/compute/bool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func (idx boolIndexComputation[R]) ForRecord(item R) indexes.Key {
2222
return BoolKey(idx.getter.Get(item))
2323
}
2424

25-
func (idx boolIndexComputation[R]) ForValue(value interface{}) indexes.Key {
25+
func (idx boolIndexComputation[R]) ForValue(value any) indexes.Key {
2626
return BoolKey(value.(bool))
2727
}
2828

indexes/compute/comparable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (idx comparableIndexComputation[R, V]) ForRecord(item R) indexes.Key {
2828
}
2929
}
3030

31-
func (idx comparableIndexComputation[R, V]) ForValue(value interface{}) indexes.Key {
31+
func (idx comparableIndexComputation[R, V]) ForValue(value any) indexes.Key {
3232
return ComparableKey[V]{
3333
Value: value.(V),
3434
}

indexes/index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Key interface {
1212

1313
type IndexComputer[R record.Record] interface {
1414
ForRecord(item R) Key
15-
ForValue(value interface{}) Key
15+
ForValue(value any) Key
1616
Check(indexKey Key, comparator where.FieldComparator[R]) (bool, error)
1717
}
1818

simd_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (t Tag) String() string {
6060

6161
type Tags map[Tag]struct{}
6262

63-
func (t Tags) Has(item interface{}) bool {
63+
func (t Tags) Has(item any) bool {
6464
value, ok := item.(Tag)
6565
if !ok {
6666
return false
@@ -78,7 +78,7 @@ const (
7878

7979
type Counters map[CounterKey]uint32
8080

81-
func (c Counters) HasKey(key interface{}) bool {
81+
func (c Counters) HasKey(key any) bool {
8282
counterKey, ok := key.(CounterKey)
8383
if !ok {
8484
return false
@@ -101,7 +101,7 @@ func (c Counters) HasValue(check record.MapValueComparator) (bool, error) {
101101

102102
type HasCounterValueEqual uint32
103103

104-
func (c HasCounterValueEqual) Compare(item interface{}) (bool, error) {
104+
func (c HasCounterValueEqual) Compare(item any) (bool, error) {
105105
return item.(uint32) == uint32(c), nil
106106
}
107107

where/comparator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ type FieldComparator[R record.Record] interface {
2323
GetType() ComparatorType
2424
Compare(item R) (bool, error)
2525
ValuesCount() int
26-
ValueAt(index int) interface{}
26+
ValueAt(index int) any
2727
}

0 commit comments

Comments
 (0)