looks like dead logic

This commit is contained in:
rusefillc 2022-09-02 22:51:18 -04:00
parent 6c74c4ab60
commit 607cdbb132
5 changed files with 1 additions and 18 deletions

View File

@ -82,8 +82,6 @@ public class ParseState {
if (stringValueMap == null)
return null;
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());

Binary file not shown.

View File

@ -12,10 +12,6 @@ import java.util.List;
import java.util.Map;
public class ToJavaEnum {
public static final String FORCE_2_BYTES_SIZE = "Force_2_bytes_size";
public static final String FORCE_4_BYTES_SIZE = "Force_4_bytes_size";
public static void main(String[] args) throws IOException {
InvokeReader invokeReader = new InvokeReader(args).invoke();
String outputPath = invokeReader.getOutputPath();
@ -53,9 +49,7 @@ public class ToJavaEnum {
int index = 0;
for (Value value : sorted) {
int numericValue = value.getIntValueMaybeResolve(registry);
if (index != numericValue
&& !value.getName().startsWith(FORCE_2_BYTES_SIZE)
&& !value.getName().startsWith(FORCE_4_BYTES_SIZE))
if (index != numericValue)
throw new IllegalStateException("Got explicit ordinal " + numericValue + " instead of ordinal " + index + " in " + value);
sb.append("\t" + value.getName() + ",\n");
index++;

View File

@ -95,8 +95,6 @@ public class VariableRegistry {
TreeMap<Integer, String> valueNameById = new TreeMap<>();
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());

View File

@ -4,9 +4,6 @@ import com.rusefi.VariableRegistry;
import java.util.Objects;
import static com.rusefi.ToJavaEnum.FORCE_2_BYTES_SIZE;
import static com.rusefi.ToJavaEnum.FORCE_4_BYTES_SIZE;
public class Value implements Comparable<Value> {
private final String name;
private final String value;
@ -16,10 +13,6 @@ public class Value implements Comparable<Value> {
this.value = value;
}
public boolean isForceSize() {
return getName().startsWith(FORCE_2_BYTES_SIZE) || getName().startsWith(FORCE_4_BYTES_SIZE);
}
public String getName() {
return name;
}