Commit 72acf824 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Use foreach loop.

parent ad4da7d8
......@@ -282,8 +282,7 @@ public class ExoneraTorDatabaseImporter {
int end = orAddress.length()
- (orAddress.endsWith("::]") ? 2 : 1);
String[] parts = orAddress.substring(start, end).split(":", -1);
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
for (String part : parts) {
if (part.length() == 0) {
addressHex.append("x");
} else if (part.length() <= 4) {
......
......@@ -269,8 +269,7 @@ public class ExoneraTorServlet extends HttpServlet {
int end = ipParameter.length()
- (ipParameter.endsWith("::") ? 1 : 0);
String[] parts = ipParameter.substring(start, end).split(":", -1);
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
for (String part : parts) {
if (part.length() == 0) {
addressHex.append("x");
} else if (part.length() <= 4) {
......
......@@ -143,8 +143,7 @@ public class QueryServlet extends HttpServlet {
int end = ipParameter.length()
- (ipParameter.endsWith("::") ? 1 : 0);
String[] parts = ipParameter.substring(start, end).split(":", -1);
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
for (String part : parts) {
if (part.length() == 0) {
addressHex.append("x");
} else if (part.length() <= 4) {
......@@ -189,8 +188,7 @@ public class QueryServlet extends HttpServlet {
int start = relayIp.startsWith("::") ? 1 : 0;
int end = relayIp.length() - (relayIp.endsWith("::") ? 1 : 0);
String[] parts = relayIp.substring(start, end).split(":", -1);
for (int i = 0; i < parts.length; i++) {
String part = parts[i];
for (String part : parts) {
if (part.length() == 0) {
addressHex.append("x");
} else if (part.length() <= 4) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment