Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Network Health
Metrics
Onionoo
Commits
cc0ed7b0
Commit
cc0ed7b0
authored
Aug 20, 2018
by
Karsten Loesing
Browse files
Avoid manual array copies.
parent
ad1ec281
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
View file @
cc0ed7b0
...
...
@@ -6,6 +6,7 @@ package org.torproject.onionoo.docs;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.Arrays
;
import
java.util.SortedSet
;
import
java.util.TreeSet
;
...
...
@@ -88,9 +89,7 @@ public class UptimeHistory implements Comparable<UptimeHistory> {
SortedSet
<
String
>
flags
=
null
;
if
(
parts
[
0
].
equals
(
"R"
))
{
flags
=
new
TreeSet
<>();
for
(
int
i
=
3
;
i
<
parts
.
length
;
i
++)
{
flags
.
add
(
parts
[
i
]);
}
flags
.
addAll
(
Arrays
.
asList
(
parts
).
subList
(
3
,
parts
.
length
));
}
return
new
UptimeHistory
(
relay
,
startMillis
,
uptimeHours
,
flags
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment