Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 51801a0

Browse files
committed
chore: random optimizations
1 parent 668c343 commit 51801a0

6 files changed

Lines changed: 11 additions & 9 deletions

File tree

bson/src/commonMain/kotlin/BsonDocumentLike.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fun mutableBsonDocumentOf(vararg pairs: Pair<String, BsonElement>): MutableBsonD
117117

118118
/**
119119
* An interface allowing custom receivers for
120-
* [MutableBsonDocumentLike.by].
120+
* [by][IMutableBsonDocumentLike.by].
121121
*
122122
* This interface will be useless after context
123123
* receivers is released for production.

bson/src/jvmMain/kotlin/BsonConstants-jvm.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ typealias JavaBsonNull =
3131
/**
3232
* Return the java version of this bson element.
3333
*/
34-
val BsonBoolean.java: JavaBsonBoolean
34+
inline val BsonBoolean.java: JavaBsonBoolean
3535
get() = when (this) {
3636
is BsonBoolean.True -> JavaBsonBoolean.TRUE
3737
is BsonBoolean.False -> JavaBsonBoolean.FALSE
@@ -40,35 +40,35 @@ val BsonBoolean.java: JavaBsonBoolean
4040
/**
4141
* Return the kotlin version of this bson element.
4242
*/
43-
val JavaBsonBoolean.kt: BsonBoolean
43+
inline val JavaBsonBoolean.kt: BsonBoolean
4444
get() = BsonBoolean(value)
4545

4646
/**
4747
* Return the java version of this bson element.
4848
*/
4949
@Suppress("UnusedReceiverParameter")
50-
val BsonUndefined.java: JavaBsonUndefined
50+
inline val BsonUndefined.java: JavaBsonUndefined
5151
get() = JavaBsonUndefined()
5252

5353
/**
5454
* Return the kotlin version of this bson element.
5555
*/
5656
@Suppress("UnusedReceiverParameter")
57-
val JavaBsonUndefined.kt: BsonUndefined
57+
inline val JavaBsonUndefined.kt: BsonUndefined
5858
get() = BsonUndefined
5959

6060
/**
6161
* Return the java version of this bson element.
6262
*/
6363
@Suppress("UnusedReceiverParameter")
64-
val BsonNull.java: JavaBsonNull
64+
inline val BsonNull.java: JavaBsonNull
6565
get() = JavaBsonNull.VALUE
6666

6767
/**
6868
* Return the kotlin version of this bson element.
6969
*/
7070
@Suppress("UnusedReceiverParameter")
71-
val JavaBsonNull.kt: BsonNull
71+
inline val JavaBsonNull.kt: BsonNull
7272
get() = BsonNull
7373

7474
/* ============= ------------------ ============= */

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = "org.cufy"
7-
version = "1.0.0"
7+
version = "2.0.0"
88

99
tasks.wrapper {
1010
gradleVersion = "8.2.1"

json/src/commonMain/kotlin/ExtensionTransform.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,5 @@ inline val Number?.json: JsonPrimitive get() = JsonPrimitive(this)
116116
inline val Boolean?.json: JsonPrimitive get() = JsonPrimitive(this)
117117

118118
/** return a [JsonPrimitive] instance from the content of this. */
119+
@Suppress("UnusedReceiverParameter")
119120
inline val Nothing?.json: JsonPrimitive get() = JsonNull

libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ kotlin = "1.9.20"
33

44
[libraries]
55
kotlin-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.4.1" }
6-
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.6.4" }
76
kotlin-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.4.0" }
87

98
mongodb-sync = { module = "org.mongodb:mongodb-driver-sync", version = "4.10.2" }

ped-bson/src/jvmMain/kotlin/Bson-jvm.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ import java.util.*
2525
*
2626
* @since 2.0.0
2727
*/
28+
@Suppress("UnusedReceiverParameter")
2829
inline val Bson.BigDecimal get() = BsonBigDecimalCodec
2930

3031
/**
3132
* The codec for [Date] and [BsonDateTime].
3233
*
3334
* @since 2.0.0
3435
*/
36+
@Suppress("UnusedReceiverParameter")
3537
inline val Bson.Date get() = BsonDateCodec

0 commit comments

Comments
 (0)