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
f8ee7cf0
Commit
f8ee7cf0
authored
Aug 20, 2018
by
Karsten Loesing
Browse files
Simplify compareTo methods.
parent
38bd70ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
View file @
f8ee7cf0
...
...
@@ -194,8 +194,7 @@ public class ClientsHistory implements Comparable<ClientsHistory> {
@Override
public
int
compareTo
(
ClientsHistory
other
)
{
return
this
.
startMillis
<
other
.
startMillis
?
-
1
:
this
.
startMillis
>
other
.
startMillis
?
1
:
0
;
return
Long
.
compare
(
this
.
startMillis
,
other
.
startMillis
);
}
@Override
...
...
src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
View file @
f8ee7cf0
...
...
@@ -128,8 +128,7 @@ public class UptimeHistory implements Comparable<UptimeHistory> {
}
else
if
(!
this
.
relay
&&
other
.
relay
)
{
return
1
;
}
return
this
.
startMillis
<
other
.
startMillis
?
-
1
:
this
.
startMillis
>
other
.
startMillis
?
1
:
0
;
return
Long
.
compare
(
this
.
startMillis
,
other
.
startMillis
);
}
@Override
...
...
Write
Preview
Supports
Markdown
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