Skip to content
Permalink
Browse files

Code cleanup

  • Loading branch information
nielsbasjes committed Dec 2, 2019
1 parent 37a7873 commit 68a86327e7dc296908e840a9d8fc2fc54b486481
Showing with 5 additions and 7 deletions.
  1. +5 −7 analyzer/src/main/java/nl/basjes/parse/useragent/analyze/Matcher.java
@@ -45,7 +45,7 @@

private final Analyzer analyzer;
private final List<MatcherVariableAction> variableActions;
private List<MatcherAction> dynamicActions;
private final List<MatcherAction> dynamicActions;
private final List<MatcherAction> fixedStringActions;

private UserAgent newValuesUserAgent = null;
@@ -244,8 +244,8 @@ public void initialize() {
}
}

fixedStringActions.forEach(action -> dynamicActions.remove(action));
uselessRequireActions.forEach(action -> dynamicActions.remove(action));
fixedStringActions.forEach(dynamicActions::remove);
uselessRequireActions.forEach(dynamicActions::remove);

// Verify that a variable only contains the variables that have been defined BEFORE it (also not referencing itself).
// If all is ok we link them
@@ -279,10 +279,8 @@ public void initialize() {
"Syntax error (" + matcherSourceLocation + "): Used, yet undefined variables: " + missingVariableNames);
}

List<MatcherAction> allDynamicActions = new ArrayList<>(variableActions.size() + dynamicActions.size());
allDynamicActions.addAll(variableActions);
allDynamicActions.addAll(dynamicActions);
dynamicActions = allDynamicActions;
// Make sure the variable actions are BEFORE the rest in the list
dynamicActions.addAll(0, variableActions);

actionsThatRequireInput = countActionsThatMustHaveMatches(dynamicActions);

0 comments on commit 68a8632

Please sign in to comment.
You can’t perform that action at this time.