Skip to content

Commit

Permalink
CASL-598 getPrevTupleNumber() refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhead-pl committed Oct 17, 2024
1 parent 1229a1a commit 7a747fa
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ data class Tuple(
/**
* @return previous tuple number if available
*/
fun getPrevTupleNumber(): TupleNumber? =
if (meta?.puid != null && meta.prevVersion != null) {
TupleNumber(storeNumber = tupleNumber.storeNumber, version = meta.prevVersion, uid = meta.puid)
fun getPrevTupleNumber(): TupleNumber? {
val puid = meta?.puid
val prevVersion = meta?.prevVersion
return if (puid != null && prevVersion != null) {
TupleNumber(storeNumber = tupleNumber.storeNumber, version = prevVersion, uid = puid)
} else {
null
}
}

}

0 comments on commit 7a747fa

Please sign in to comment.