[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [collector/release] Replace Option.ifPresent() with functional style.



commit 4204fcfd62275e2a378f2940310857bc8658d646
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Aug 20 15:37:32 2018 +0200

    Replace Option.ifPresent() with functional style.
---
 .../java/org/torproject/metrics/collector/webstats/LogFileMap.java    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/java/org/torproject/metrics/collector/webstats/LogFileMap.java b/src/main/java/org/torproject/metrics/collector/webstats/LogFileMap.java
index 6d9e22d..2036b1f 100644
--- a/src/main/java/org/torproject/metrics/collector/webstats/LogFileMap.java
+++ b/src/main/java/org/torproject/metrics/collector/webstats/LogFileMap.java
@@ -39,9 +39,7 @@ public class LogFileMap
         @Override
         public FileVisitResult visitFile(Path path, BasicFileAttributes att) {
             Optional<LogMetadata> optionalMetadata = LogMetadata.create(path);
-          if (optionalMetadata.isPresent()) {
-            logFileMap.add(optionalMetadata.get());
-          }
+          optionalMetadata.ifPresent(logFileMap::add);
           return FileVisitResult.CONTINUE;
         }
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits