I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 85db853d authored by zab2's avatar zab2
Browse files

use curly braces around one-line for and while loops

parent 440d5571
Branches
Tags
No related merge requests found
......@@ -34,8 +34,9 @@ class AccessCounter {
* @return true if there is nothing left in the access history
*/
boolean purge(long olderThan) {
while(!accesses.isEmpty() && accesses.get(0) < olderThan)
while(!accesses.isEmpty() && accesses.get(0) < olderThan) {
accesses.remove(0);
}
return accesses.isEmpty();
}
}
......@@ -75,8 +75,9 @@ class AccessFilter implements IncomingConnectionFilter {
private void reload() throws IOException {
synchronized(knownDests) {
for (FilterDefinitionElement element : definition.getElements())
for (FilterDefinitionElement element : definition.getElements()) {
element.update(knownDests);
}
}
}
......@@ -102,8 +103,9 @@ class AccessFilter implements IncomingConnectionFilter {
try {
reader = new BufferedReader(new FileReader(file));
String b32;
while((b32 = reader.readLine()) != null)
while((b32 = reader.readLine()) != null) {
breached.add(b32);
}
} finally {
if (reader != null) try { reader.close(); } catch (IOException ignored) {}
}
......@@ -128,8 +130,9 @@ class AccessFilter implements IncomingConnectionFilter {
long olderThan = context.clock().now() - definition.getPurgeMinutes() * 60000;
synchronized(knownDests) {
for (DestTracker tracker : knownDests.values())
for (DestTracker tracker : knownDests.values()) {
tracker.purge(olderThan);
}
}
synchronized(unknownDests) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment