[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/release] Replace String.indexOf with .contains.
commit 3323843202d5151b32cb2a84ac1d09a64825d9d1
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Mon Aug 20 15:33:52 2018 +0200
Replace String.indexOf with .contains.
---
src/main/java/org/torproject/metrics/web/UpdateNews.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/metrics/web/UpdateNews.java b/src/main/java/org/torproject/metrics/web/UpdateNews.java
index a1b9249..4de7952 100644
--- a/src/main/java/org/torproject/metrics/web/UpdateNews.java
+++ b/src/main/java/org/torproject/metrics/web/UpdateNews.java
@@ -101,10 +101,10 @@ public class UpdateNews {
String shortDesc = desc
.replaceAll("\\<.*?\\>", "")
.replaceAll("&.*;", "");
- if (shortDesc.indexOf(". ") != -1) {
+ if (shortDesc.contains(". ")) {
shortDesc = shortDesc.substring(0, shortDesc.indexOf(". "));
}
- if (shortDesc.indexOf(" (") != -1) {
+ if (shortDesc.contains(" (")) {
shortDesc = shortDesc.substring(0, shortDesc.indexOf(" ("));
}
entry.shortDescription = shortDesc;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits