Skip to content

Commit

Permalink
style: move return statement and use if expression
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGiulianelli committed Apr 23, 2023
1 parent 179fd44 commit 01569b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/kotlin/infrastructure/database/DatabaseManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
end: Instant,
): List<Pair<Instant, RoomEnvironmentalData>>? {
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,
Expand All @@ -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
}
}

Expand Down

0 comments on commit 01569b8

Please sign in to comment.