Reorder match

this way, all the cases returning min_lsn are at the top
This commit is contained in:
Arpad Müller
2023-10-25 20:52:05 +02:00
parent 57095b98c1
commit 3b4872eea7

View File

@@ -365,6 +365,10 @@ impl Timeline {
// just after importing a cluster.
Ok(LsnForTimestamp::NoData(min_lsn))
}
(false, true) => {
// Didn't find any commit timestamps smaller than the request
Ok(LsnForTimestamp::Past(min_lsn))
}
(true, false) => {
// Only found a commit with timestamp smaller than the request.
// It's still a valid case for branch creation, return it.
@@ -372,10 +376,6 @@ impl Timeline {
// case, anyway.
Ok(LsnForTimestamp::Future(commit_lsn))
}
(false, true) => {
// Didn't find any commit timestamps smaller than the request
Ok(LsnForTimestamp::Past(min_lsn))
}
(true, true) => Ok(LsnForTimestamp::Present(commit_lsn)),
}
}