optimizing constant expressions in profile parsing

This commit is contained in:
Arndt Brenschede 2023-06-25 12:51:10 +02:00
parent ef73d468c0
commit de0acb77c5
4 changed files with 117 additions and 15 deletions

View file

@ -91,8 +91,8 @@ public final class ProfileCache {
meta.readMetaData(new File(profileDir, "lookups.dat"));
rc.expctxWay.parseFile(profileFile, "global");
rc.expctxNode.parseFile(profileFile, "global");
rc.expctxWay.parseFile(profileFile, "global", rc.keyValues);
rc.expctxNode.parseFile(profileFile, "global", rc.keyValues);
rc.readGlobalConfig();

View file

@ -108,16 +108,6 @@ public final class RoutingContext {
public void readGlobalConfig() {
BExpressionContext expctxGlobal = expctxWay; // just one of them...
if (keyValues != null) {
// add parameter to context
for (Map.Entry<String, String> e : keyValues.entrySet()) {
float f = Float.parseFloat(e.getValue());
expctxWay.setVariableValue(e.getKey(), f, true);
expctxNode.setVariableValue(e.getKey(), f, true);
}
}
setModel(expctxGlobal._modelClass);
carMode = 0.f != expctxGlobal.getVariableValue("validForCars", 0.f);