Skip to content

Commit 9e4ee18

Browse files
MarkCBBBillWagner
authored andcommitted
Including the 0 element in the iteration (#776)
When iterating a collection in a reverse order the 0 index should be included.
1 parent e9effe5 commit 9e4ee18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

snippets/cpp/VS_Snippets_CLR/EventLogEntry_Source/CPP/eventlogentry_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main()
4848
int myCount = myLogEntryCollection->Count;
4949

5050
// Iterate through all 'EventLogEntry' instances in 'EventLog'.
51-
for ( int i = myCount - 1; i > 0; i-- )
51+
for ( int i = myCount - 1; i > -1; i-- )
5252
{
5353
EventLogEntry^ myLogEntry = myLogEntryCollection[ i ];
5454

0 commit comments

Comments
 (0)