Skip to content

Commit 669d3a9

Browse files
sdeleuzechristophstrobl
authored andcommitted
DATAREDIS-1033 - Avoid inline reified extensions when unnecessary
Original Pull Request: #477
1 parent 6db2a06 commit 669d3a9

9 files changed

+132
-132
lines changed

src/main/kotlin/org/springframework/data/redis/core/ReactiveGeoOperationsExtensions.kt

+12-12
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import org.springframework.data.redis.connection.RedisGeoCommands
2828
* @author Mark Paluch
2929
* @since 2.2
3030
*/
31-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, point: Point, member: M): Long =
31+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, point: Point, member: M): Long =
3232
add(key, point, member).awaitSingle()
3333

3434
/**
@@ -37,7 +37,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
3737
* @author Mark Paluch
3838
* @since 2.2
3939
*/
40-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, location: RedisGeoCommands.GeoLocation<M>): Long =
40+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, location: RedisGeoCommands.GeoLocation<M>): Long =
4141
add(key, location).awaitSingle()
4242

4343
/**
@@ -46,7 +46,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
4646
* @author Mark Paluch
4747
* @since 2.2
4848
*/
49-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, memberCoordinateMap: Map<M, Point>): Long =
49+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, memberCoordinateMap: Map<M, Point>): Long =
5050
add(key, memberCoordinateMap).awaitSingle()
5151

5252
/**
@@ -55,7 +55,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
5555
* @author Mark Paluch
5656
* @since 2.2
5757
*/
58-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, locations: Iterable<RedisGeoCommands.GeoLocation<M>>): Long =
58+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.addAndAwait(key: K, locations: Iterable<RedisGeoCommands.GeoLocation<M>>): Long =
5959
add(key, locations).awaitSingle()
6060

6161
/**
@@ -65,7 +65,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
6565
* @author Christoph Strobl
6666
* @since 2.2
6767
*/
68-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.distanceAndAwait(key: K, member1: M, member2: M): Distance? =
68+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.distanceAndAwait(key: K, member1: M, member2: M): Distance? =
6969
distance(key, member1, member2).awaitFirstOrNull()
7070

7171
/**
@@ -75,7 +75,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
7575
* @author Christoph Strobl
7676
* @since 2.2
7777
*/
78-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.distanceAndAwait(key: K, member1: M, member2: M, metric: Metric): Distance? =
78+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.distanceAndAwait(key: K, member1: M, member2: M, metric: Metric): Distance? =
7979
distance(key, member1, member2, metric).awaitFirstOrNull()
8080

8181
/**
@@ -85,7 +85,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
8585
* @author Christoph Strobl
8686
* @since 2.2
8787
*/
88-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.hashAndAwait(key: K, member: M): String? =
88+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.hashAndAwait(key: K, member: M): String? =
8989
hash(key, member).awaitFirstOrNull()
9090

9191
/**
@@ -94,7 +94,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
9494
* @author Mark Paluch
9595
* @since 2.2
9696
*/
97-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.hashAndAwait(key: K, vararg member: M): List<String> =
97+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.hashAndAwait(key: K, vararg member: M): List<String> =
9898
hash(key, *member).awaitSingle()
9999

100100
/**
@@ -103,7 +103,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
103103
* @author Mark Paluch
104104
* @since 2.2
105105
*/
106-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.positionAndAwait(key: K, member: M): Point? =
106+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.positionAndAwait(key: K, member: M): Point? =
107107
position(key, member).awaitFirstOrNull()
108108

109109
/**
@@ -112,7 +112,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
112112
* @author Mark Paluch
113113
* @since 2.2
114114
*/
115-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.positionAndAwait(key: K, vararg members: M): List<Point> =
115+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.positionAndAwait(key: K, vararg members: M): List<Point> =
116116
position(key, *members).awaitSingle()
117117

118118
/**
@@ -121,7 +121,7 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
121121
* @author Mark Paluch
122122
* @since 2.2
123123
*/
124-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.removeAndAwait(key: K, vararg member: M): Long =
124+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.removeAndAwait(key: K, vararg member: M): Long =
125125
remove(key, *member).awaitSingle()
126126

127127
/**
@@ -130,5 +130,5 @@ suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M
130130
* @author Mark Paluch
131131
* @since 2.2
132132
*/
133-
suspend inline fun <reified K : Any, reified M : Any> ReactiveGeoOperations<K, M>.deleteAndAwait(key: K): Boolean =
133+
suspend fun <K : Any, M : Any> ReactiveGeoOperations<K, M>.deleteAndAwait(key: K): Boolean =
134134
delete(key).awaitSingle()

src/main/kotlin/org/springframework/data/redis/core/ReactiveHashOperationsExtensions.kt

+11-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import kotlinx.coroutines.reactive.awaitSingle
2424
* @author Mark Paluch
2525
* @since 2.2
2626
*/
27-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.hasKeyAndAwait(key: H, hashKey: HK): Boolean =
27+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.hasKeyAndAwait(key: H, hashKey: HK): Boolean =
2828
hasKey(key, hashKey).awaitSingle()
2929

3030
/**
@@ -34,7 +34,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
3434
* @author Christoph Strobl
3535
* @since 2.2
3636
*/
37-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.getAndAwait(key: H, hashKey: HK): HV? =
37+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.getAndAwait(key: H, hashKey: HK): HV? =
3838
get(key, hashKey).awaitFirstOrNull()
3939

4040
/**
@@ -43,7 +43,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
4343
* @author Mark Paluch
4444
* @since 2.2
4545
*/
46-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.multiGetAndAwait(key: H, vararg hashKeys: HK): List<HV?> =
46+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.multiGetAndAwait(key: H, vararg hashKeys: HK): List<HV?> =
4747
multiGet(key, hashKeys.toCollection(ArrayList())).awaitSingle()
4848

4949
/**
@@ -52,7 +52,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
5252
* @author Mark Paluch
5353
* @since 2.2
5454
*/
55-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.incrementAndAwait(key: H, hashKey: HK, delta: Long): Long =
55+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.incrementAndAwait(key: H, hashKey: HK, delta: Long): Long =
5656
increment(key, hashKey, delta).awaitSingle()
5757

5858
/**
@@ -61,7 +61,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
6161
* @author Mark Paluch
6262
* @since 2.2
6363
*/
64-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.incrementAndAwait(key: H, hashKey: HK, delta: Double): Double =
64+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.incrementAndAwait(key: H, hashKey: HK, delta: Double): Double =
6565
increment(key, hashKey, delta).awaitSingle()
6666

6767
/**
@@ -70,7 +70,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
7070
* @author Mark Paluch
7171
* @since 2.2
7272
*/
73-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.sizeAndAwait(key: H): Long =
73+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.sizeAndAwait(key: H): Long =
7474
size(key).awaitSingle()
7575

7676
/**
@@ -79,7 +79,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
7979
* @author Mark Paluch
8080
* @since 2.2
8181
*/
82-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.putAllAndAwait(key: H, map: Map<HK, HV>): Boolean =
82+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.putAllAndAwait(key: H, map: Map<HK, HV>): Boolean =
8383
putAll(key, map).awaitSingle()
8484

8585
/**
@@ -88,7 +88,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
8888
* @author Mark Paluch
8989
* @since 2.2
9090
*/
91-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.putAndAwait(key: H, hashKey: HK, hashValue: HV): Boolean =
91+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.putAndAwait(key: H, hashKey: HK, hashValue: HV): Boolean =
9292
put(key, hashKey, hashValue).awaitSingle()
9393

9494
/**
@@ -97,7 +97,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
9797
* @author Mark Paluch
9898
* @since 2.2
9999
*/
100-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.putIfAbsentAndAwait(key: H, hashKey: HK, hashValue: HV): Boolean =
100+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.putIfAbsentAndAwait(key: H, hashKey: HK, hashValue: HV): Boolean =
101101
putIfAbsent(key, hashKey, hashValue).awaitSingle()
102102

103103
/**
@@ -106,7 +106,7 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
106106
* @author Mark Paluch
107107
* @since 2.2
108108
*/
109-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.removeAndAwait(key: H, vararg hashKeys: Any): Long =
109+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.removeAndAwait(key: H, vararg hashKeys: Any): Long =
110110
remove(key, *hashKeys).awaitSingle()
111111

112112
/**
@@ -115,5 +115,5 @@ suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> Reactiv
115115
* @author Christoph Strobl
116116
* @since 2.2
117117
*/
118-
suspend inline fun <reified H : Any, reified HK : Any, reified HV : Any> ReactiveHashOperations<H, HK, HV>.deleteAndAwait(key: H): Boolean =
118+
suspend fun <H : Any, HK : Any, HV : Any> ReactiveHashOperations<H, HK, HV>.deleteAndAwait(key: H): Boolean =
119119
delete(key).awaitSingle()

src/main/kotlin/org/springframework/data/redis/core/ReactiveHyperLogLogOperationsExtensions.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import kotlinx.coroutines.reactive.awaitSingle
2323
* @author Mark Paluch
2424
* @since 2.2
2525
*/
26-
suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperations<K, V>.addAndAwait(key: K, vararg values: V): Long =
26+
suspend fun <K : Any, V : Any> ReactiveHyperLogLogOperations<K, V>.addAndAwait(key: K, vararg values: V): Long =
2727
add(key, *values).awaitSingle()
2828

2929
/**
@@ -32,7 +32,7 @@ suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperati
3232
* @author Mark Paluch
3333
* @since 2.2
3434
*/
35-
suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperations<K, V>.sizeAndAwait(vararg keys: K): Long =
35+
suspend fun <K : Any, V : Any> ReactiveHyperLogLogOperations<K, V>.sizeAndAwait(vararg keys: K): Long =
3636
size(*keys).awaitSingle()
3737

3838
/**
@@ -41,7 +41,7 @@ suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperati
4141
* @author Mark Paluch
4242
* @since 2.2
4343
*/
44-
suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperations<K, V>.unionAndAwait(destination: K, vararg sourceKeys: K): Boolean =
44+
suspend fun <K : Any, V : Any> ReactiveHyperLogLogOperations<K, V>.unionAndAwait(destination: K, vararg sourceKeys: K): Boolean =
4545
union(destination, *sourceKeys).awaitSingle()
4646

4747
/**
@@ -50,5 +50,5 @@ suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperati
5050
* @author Mark Paluch
5151
* @since 2.2
5252
*/
53-
suspend inline fun <reified K : Any, reified V : Any> ReactiveHyperLogLogOperations<K, V>.deleteAndAwait(key: K): Boolean =
53+
suspend fun <K : Any, V : Any> ReactiveHyperLogLogOperations<K, V>.deleteAndAwait(key: K): Boolean =
5454
delete(key).awaitSingle()

0 commit comments

Comments
 (0)