From 01569b82b87021a7cc9a50aaced27a2b43bd5255 Mon Sep 17 00:00:00 2001 From: Andrea Giulianelli Date: Sun, 23 Apr 2023 10:14:52 +0200 Subject: [PATCH] style: move return statement and use if expression --- src/main/kotlin/infrastructure/database/DatabaseManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/infrastructure/database/DatabaseManager.kt b/src/main/kotlin/infrastructure/database/DatabaseManager.kt index 53ebc7a7..6459f6fd 100644 --- a/src/main/kotlin/infrastructure/database/DatabaseManager.kt +++ b/src/main/kotlin/infrastructure/database/DatabaseManager.kt @@ -88,9 +88,9 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana end: Instant, ): List>? { var roomCurrentData = this.findBy(roomId, start)?.environmentalData - if (roomCurrentData != null) { + return if (roomCurrentData != null) { // The room exist - return this.roomTimeSeriesCollection.find( + this.roomTimeSeriesCollection.find( TimeSeriesRoomEnvironmentalData::metadata / TimeSeriesRoomMetadata::roomId eq roomId, TimeSeriesRoomEnvironmentalData::dateTime gt start, TimeSeriesRoomEnvironmentalData::dateTime lte end, @@ -102,7 +102,7 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana it.dateTime to updatedRoom } } else { - return null // The room does not exist + null // The room does not exist } }