mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
Throttle: Don't parse default values every time
This commit is contained in:
@@ -499,17 +499,23 @@ public class RouterThrottleImpl implements RouterThrottle {
|
||||
|
||||
private double getTunnelGrowthFactor() {
|
||||
try {
|
||||
return Double.parseDouble(_context.getProperty("router.tunnelGrowthFactor", "1.3"));
|
||||
String p = _context.getProperty("router.tunnelGrowthFactor");
|
||||
if (p == null)
|
||||
return 1.3d;
|
||||
return Double.parseDouble(p);
|
||||
} catch (NumberFormatException nfe) {
|
||||
return 1.3;
|
||||
return 1.3d;
|
||||
}
|
||||
}
|
||||
|
||||
private double getTunnelTestTimeGrowthFactor() {
|
||||
try {
|
||||
return Double.parseDouble(_context.getProperty("router.tunnelTestTimeGrowthFactor", "1.3"));
|
||||
String p = _context.getProperty("router.tunnelTestTimeGrowthFactor");
|
||||
if (p == null)
|
||||
return 1.3d;
|
||||
return Double.parseDouble(p);
|
||||
} catch (NumberFormatException nfe) {
|
||||
return 1.3;
|
||||
return 1.3d;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user