diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-06-24 20:02:59 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-07-01 11:31:36 +0300 |
commit | 84d8eff3058783f65d310ebe4c8601fccad12ff7 (patch) | |
tree | 86a7e0a4656969aa27bf5c3d3131186a34100822 /main/src/core/MonoDevelop.Core | |
parent | 31dca318663a77fe5719f34349aa37a9ddeb99e0 (diff) |
[Projects] Avoid using LastIndexOf when not necessary
Diffstat (limited to 'main/src/core/MonoDevelop.Core')
-rw-r--r-- | main/src/core/MonoDevelop.Core/MonoDevelop.Projects.FileNesting/NestingRule.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.FileNesting/NestingRule.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.FileNesting/NestingRule.cs index 67545fde04..b1709e12c5 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.FileNesting/NestingRule.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.FileNesting/NestingRule.cs @@ -107,7 +107,7 @@ namespace MonoDevelop.Projects.FileNesting case NestingRuleKind.FileSuffixToExtension: string inputFileString = inputFile; if (inputFileString.EndsWith (AppliesTo, StringComparison.OrdinalIgnoreCase)) { - int suffixPosition = inputFileString.LastIndexOf (AppliesTo, StringComparison.OrdinalIgnoreCase); + int suffixPosition = inputFileString.Length - AppliesTo.Length; foreach (var pt in patterns) { parentFile = inputFileString.Remove (suffixPosition, AppliesTo.Length).Insert (suffixPosition, pt); if (CheckParentForFile (project, inputFile, parentFile)) { |