Skip to content

Commit 12d2fb1

Browse files
committed
Implement suggestion from the code quality analyzer: Calls to 'string.IndexOf' where the result is used to check for the presence/absence of a substring can be replaced by 'string.Contains'
1 parent 79e1abe commit 12d2fb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GitReleaseManager.Core/MappingProfiles/GitHubProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public GitHubProfile()
1313
CreateMap<Octokit.Issue, Model.Issue>()
1414
.ForMember(dest => dest.PublicNumber, act => act.MapFrom(src => src.Number))
1515
.ForMember(dest => dest.InternalNumber, act => act.MapFrom(src => src.Id))
16-
.ForMember(dest => dest.IsPullRequest, act => act.MapFrom(src => src.HtmlUrl.IndexOf("/pull/", StringComparison.OrdinalIgnoreCase) >= 0))
16+
.ForMember(dest => dest.IsPullRequest, act => act.MapFrom(src => src.HtmlUrl.Contains("/pull/", StringComparison.OrdinalIgnoreCase)))
1717
.ReverseMap();
1818
CreateMap<Model.IssueComment, Octokit.IssueComment>().ReverseMap();
1919
CreateMap<Model.ItemState, Octokit.ItemState>().ReverseMap();

0 commit comments

Comments
 (0)