Throttle: Don't parse default values every time

This commit is contained in:
zzz
2022-12-26 14:47:33 -05:00
parent b5ce70955b
commit 32ffd056a1

View File

@@ -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;
}
}