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

[tor-commits] [collector/release] Add lines according to their count.



commit 2c00f28ab7eaba0310d2d96eda7f81f2a301a4a5
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date:   Wed Mar 7 13:46:54 2018 +0000

    Add lines according to their count.
    
    Making the test from the previous commit pass and fixing task-25522.
---
 src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
index 8ef9dde..df178b4 100644
--- a/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
+++ b/src/main/java/org/torproject/collector/webstats/SanitizeWeblogs.java
@@ -47,6 +47,7 @@ import java.util.SortedSet;
 import java.util.StringJoiner;
 import java.util.TreeMap;
 import java.util.TreeSet;
+import java.util.function.UnaryOperator;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -188,7 +189,7 @@ public class SanitizeWeblogs extends CollecTorMain {
   }
 
   public static byte[] bytesFor(String line, long times) {
-    return Stream.of(line).limit(times)
+    return Stream.iterate(line, UnaryOperator.identity()).limit(times)
         .collect(Collectors.joining("\n", "", "\n")).getBytes();
   }
 



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