Prevent merge if it's 'this'
This commit is contained in:
parent
c3eacf9000
commit
82896a018f
|
@ -62,6 +62,8 @@ namespace de4dot.code.renamer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Merge(ExistingNames other) {
|
public void Merge(ExistingNames other) {
|
||||||
|
if (this == other)
|
||||||
|
return;
|
||||||
foreach (var key in other.allNames.Keys)
|
foreach (var key in other.allNames.Keys)
|
||||||
allNames[key] = true;
|
allNames[key] = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,8 @@ namespace de4dot.code.renamer {
|
||||||
protected abstract string FixName(string prefix, string name);
|
protected abstract string FixName(string prefix, string name);
|
||||||
|
|
||||||
public virtual TypeNames Merge(TypeNames other) {
|
public virtual TypeNames Merge(TypeNames other) {
|
||||||
|
if (this == other)
|
||||||
|
return this;
|
||||||
foreach (var pair in other.typeNames) {
|
foreach (var pair in other.typeNames) {
|
||||||
NameCreator nc;
|
NameCreator nc;
|
||||||
if (typeNames.TryGetValue(pair.Key, out nc))
|
if (typeNames.TryGetValue(pair.Key, out nc))
|
||||||
|
|
|
@ -61,6 +61,8 @@ namespace de4dot.code.renamer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableNameState Merge(VariableNameState other) {
|
public VariableNameState Merge(VariableNameState other) {
|
||||||
|
if (this == other)
|
||||||
|
return this;
|
||||||
existingVariableNames.Merge(other.existingVariableNames);
|
existingVariableNames.Merge(other.existingVariableNames);
|
||||||
existingMethodNames.Merge(other.existingMethodNames);
|
existingMethodNames.Merge(other.existingMethodNames);
|
||||||
existingPropertyNames.Merge(other.existingPropertyNames);
|
existingPropertyNames.Merge(other.existingPropertyNames);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user