Skip to content

Commit 01569b8

Browse files
style: move return statement and use if expression
1 parent 179fd44 commit 01569b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/infrastructure/database/DatabaseManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
8888
end: Instant,
8989
): List<Pair<Instant, RoomEnvironmentalData>>? {
9090
var roomCurrentData = this.findBy(roomId, start)?.environmentalData
91-
if (roomCurrentData != null) {
91+
return if (roomCurrentData != null) {
9292
// The room exist
93-
return this.roomTimeSeriesCollection.find(
93+
this.roomTimeSeriesCollection.find(
9494
TimeSeriesRoomEnvironmentalData::metadata / TimeSeriesRoomMetadata::roomId eq roomId,
9595
TimeSeriesRoomEnvironmentalData::dateTime gt start,
9696
TimeSeriesRoomEnvironmentalData::dateTime lte end,
@@ -102,7 +102,7 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
102102
it.dateTime to updatedRoom
103103
}
104104
} else {
105-
return null // The room does not exist
105+
null // The room does not exist
106106
}
107107
}
108108

0 commit comments

Comments
 (0)