Browse Source

Improve AssignVariableNames.IsPlural

pull/881/merge
Siegfried Pammer 8 years ago
parent
commit
63cb56b996
  1. 4
      ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

4
ICSharpCode.Decompiler/IL/Transforms/AssignVariableNames.cs

@ -436,6 +436,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
proposedName = baseName.Remove(baseName.Length - 3) + "y"; proposedName = baseName.Remove(baseName.Length - 3) + "y";
return true; return true;
} }
if (baseName.EndsWith("es", StringComparison.OrdinalIgnoreCase) && baseName.Length > 2) {
proposedName = baseName.Remove(baseName.Length - 2);
return true;
}
if (baseName.EndsWith("s", StringComparison.OrdinalIgnoreCase) && baseName.Length > 1) { if (baseName.EndsWith("s", StringComparison.OrdinalIgnoreCase) && baseName.Length > 1) {
proposedName = baseName.Remove(baseName.Length - 1); proposedName = baseName.Remove(baseName.Length - 1);
return true; return true;

Loading…
Cancel
Save