From 3b4872eea70210f437af3d0614673168db308584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Wed, 25 Oct 2023 20:52:05 +0200 Subject: [PATCH] Reorder match this way, all the cases returning min_lsn are at the top --- pageserver/src/pgdatadir_mapping.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pageserver/src/pgdatadir_mapping.rs b/pageserver/src/pgdatadir_mapping.rs index 1fc57bb0c7..9ce059de1f 100644 --- a/pageserver/src/pgdatadir_mapping.rs +++ b/pageserver/src/pgdatadir_mapping.rs @@ -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)), } }