Merge remote-tracking branch 'origin/GP-3224_RenameFlexibility'

(Closes #4863)
This commit is contained in:
Ryan Kurtz 2023-04-06 12:11:27 -04:00
commit ca9a56b5f4
3 changed files with 2 additions and 16 deletions

View File

@ -76,9 +76,7 @@ public class IsolateVariableTask extends RenameTask {
}
return true;
}
LocalSymbolMap localSymbolMap = highFunction.getLocalSymbolMap();
if (localSymbolMap.containsVariableWithName(newName) ||
isSymbolInFunction(function, newName)) {
if (isSymbolInFunction(function, newName)) {
errorMsg = "Duplicate name";
return false;
}

View File

@ -60,9 +60,7 @@ public class RenameVariableTask extends RenameTask {
@Override
public boolean isValid(String newNm) {
newName = newNm;
LocalSymbolMap localSymbolMap = hfunction.getLocalSymbolMap();
if (localSymbolMap.containsVariableWithName(newName) ||
isSymbolInFunction(function, newName)) {
if (isSymbolInFunction(function, newName)) {
errorMsg = "Duplicate name";
return false;
}

View File

@ -425,16 +425,6 @@ public class LocalSymbolMap {
return (HighParam) paramSymbols[i].getHighVariable();
}
public boolean containsVariableWithName(String name) {
Collection<HighSymbol> values = symbolMap.values();
for (HighSymbol sym : values) {
if (sym.getName().equals(name)) {
return true;
}
}
return false;
}
protected HighSymbol newMappedSymbol(long id, String nm, DataType dt, VariableStorage store,
Address pcaddr, int slot) {
if (id == 0) {