File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -872,29 +872,31 @@ private static IEnumerable<List<HotSpot>> PartitionSelectedNodes(IEnumerable<Hot
872872 {
873873 Contract . Requires ( selection != null ) ;
874874
875- var it = selection . GetEnumerator ( ) ;
876- if ( ! it . MoveNext ( ) )
875+ List < HotSpot > partition ;
876+ using ( var it = selection . GetEnumerator ( ) )
877877 {
878- yield break ;
879- }
878+ if ( ! it . MoveNext ( ) )
879+ {
880+ yield break ;
881+ }
880882
881- var partition = new List < HotSpot > ( ) ;
882- partition . Add ( it . Current ) ;
883+ partition = new List < HotSpot > { it . Current } ;
883884
884- var last = it . Current ;
885+ var last = it . Current ;
885886
886- while ( it . MoveNext ( ) )
887- {
888- if ( it . Current . Address != last . Address + last . Node . MemorySize )
887+ while ( it . MoveNext ( ) )
889888 {
890- yield return partition ;
889+ if ( it . Current . Address != last . Address + last . Node . MemorySize )
890+ {
891+ yield return partition ;
891892
892- partition = new List < HotSpot > ( ) ;
893- }
893+ partition = new List < HotSpot > ( ) ;
894+ }
894895
895- partition . Add ( it . Current ) ;
896+ partition . Add ( it . Current ) ;
896897
897- last = it . Current ;
898+ last = it . Current ;
899+ }
898900 }
899901
900902 if ( partition . Count != 0 )
You can’t perform that action at this time.
0 commit comments