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
872
872
{
873
873
Contract . Requires ( selection != null ) ;
874
874
875
- var it = selection . GetEnumerator ( ) ;
876
- if ( ! it . MoveNext ( ) )
875
+ List < HotSpot > partition ;
876
+ using ( var it = selection . GetEnumerator ( ) )
877
877
{
878
- yield break ;
879
- }
878
+ if ( ! it . MoveNext ( ) )
879
+ {
880
+ yield break ;
881
+ }
880
882
881
- var partition = new List < HotSpot > ( ) ;
882
- partition . Add ( it . Current ) ;
883
+ partition = new List < HotSpot > { it . Current } ;
883
884
884
- var last = it . Current ;
885
+ var last = it . Current ;
885
886
886
- while ( it . MoveNext ( ) )
887
- {
888
- if ( it . Current . Address != last . Address + last . Node . MemorySize )
887
+ while ( it . MoveNext ( ) )
889
888
{
890
- yield return partition ;
889
+ if ( it . Current . Address != last . Address + last . Node . MemorySize )
890
+ {
891
+ yield return partition ;
891
892
892
- partition = new List < HotSpot > ( ) ;
893
- }
893
+ partition = new List < HotSpot > ( ) ;
894
+ }
894
895
895
- partition . Add ( it . Current ) ;
896
+ partition . Add ( it . Current ) ;
896
897
897
- last = it . Current ;
898
+ last = it . Current ;
899
+ }
898
900
}
899
901
900
902
if ( partition . Count != 0 )
You can’t perform that action at this time.
0 commit comments