This is an automated email from the ASF dual-hosted git repository.

shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new dbf682d76c Remove unnecessary hasExplicitLac check (#3748)
dbf682d76c is described below

commit dbf682d76c368c9a805a1689cfc134e3f78ac9c0
Author: houxiaoyu <[email protected]>
AuthorDate: Sun Jan 29 09:19:13 2023 +0800

    Remove unnecessary hasExplicitLac check (#3748)
    
    Descriptions of the changes in this PR:
    
    
    
    ### Motivation
    
    Remove the unnecessary `ledgerData.hasExplicitLac()` check,  because we 
have check it at Line985
    
    ### Changes
    
    Remove the unnecessary `ledgerData.hasExplicitLac()` check
---
 .../bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java     | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
index 1f431c0267..b91067d23d 100644
--- 
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
+++ 
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java
@@ -988,13 +988,11 @@ public class SingleDirectoryDbLedgerStorage implements 
CompactableLedgerStorage
             }
             return null;
         }
-        if (ledgerData.hasExplicitLac()) {
-            if (log.isDebugEnabled()) {
-                log.debug("getExplicitLac ledger {} returned from LedgerData", 
ledgerId);
-            }
-            ByteString persistedLac = ledgerData.getExplicitLac();
-            
ledgerInfo.setExplicitLac(Unpooled.wrappedBuffer(persistedLac.toByteArray()));
+        if (log.isDebugEnabled()) {
+            log.debug("getExplicitLac ledger {} returned from LedgerData", 
ledgerId);
         }
+        ByteString persistedLac = ledgerData.getExplicitLac();
+        
ledgerInfo.setExplicitLac(Unpooled.wrappedBuffer(persistedLac.toByteArray()));
         return ledgerInfo.getExplicitLac();
     }
 

Reply via email to