Skip to content

Commit a3c5915

Browse files
Potential fix for code scanning alert no. 1252: Missed opportunity to use Where
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 30029de commit a3c5915

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/SIL.XForge.Scripture.Tests/Services/NotesFormatterTests.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,8 @@ private static XElement BuildExpectedTagElement(string elementName, CommentTag?
661661
return element;
662662

663663
PropertyInfo[] properties = typeof(CommentTag).GetProperties(BindingFlags.Instance | BindingFlags.Public);
664-
foreach (PropertyInfo property in properties)
664+
foreach (PropertyInfo property in properties.Where(p => p.CanRead))
665665
{
666-
if (!property.CanRead)
667-
continue;
668666

669667
object? value = property.GetValue(commentTag);
670668
if (value == null)

0 commit comments

Comments
 (0)