Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 21, 2015, 7:05:53 PM (8 years ago)
Author:
muemart
Message:

Run clang-modernize -loop-convert

  • Again, not all possible loops were converted
  • It can do pretty cool transformations, but I had to fix a few compile errors, so there might be some runtime errors lurking around too
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/jump/Jump.cc

    r10817 r10821  
    633633
    634634
    635         for (int i = 0; i < numI; ++i)
     635        for (auto & elem : matrix)
    636636        {
    637637            for (int j = 0; j < numJ; ++j)
    638638            {
    639                 matrix[i][j].type = PLATFORM_EMPTY;
    640                 matrix[i][j].done = false;
     639                elem[j].type = PLATFORM_EMPTY;
     640                elem[j].done = false;
    641641            }
    642642        }
     
    795795
    796796        // Fill matrix with selected platform types
    797         for (int i = 0; i < numI; ++ i)
     797        for (auto & elem : matrix)
    798798        {
    799799            for (int j = 0; j < numJ; ++ j)
     
    801801                if (rand()%3 == 0)
    802802                {
    803                     matrix[i][j].type = platformtype1;
     803                    elem[j].type = platformtype1;
    804804                }
    805805                else
    806806                {
    807                     matrix[i][j].type = platformtype2;
     807                    elem[j].type = platformtype2;
    808808                }
    809                 matrix[i][j].done = false;
     809                elem[j].done = false;
    810810            }
    811811        }
Note: See TracChangeset for help on using the changeset viewer.