@@ -516,16 +516,14 @@ void compute_non_covers()
516516
517517 float cumulative_weight = 0 .f ;
518518 {
519- COVERS::const_iterator i = nearest.begin ();
520- COVERS::const_iterator e = nearest.end ();
521- for (; i != e; ++i)
519+ for (auto &i : nearest)
522520 {
523- if (!vertex_in_direction (u32 (I - B), (*i) ->level_vertex_id ()))
521+ if (!vertex_in_direction (u32 (I - B), i ->level_vertex_id ()))
524522 continue ;
525523
526- float weight = 1 .f / (*i) ->position ().distance_to ((*I).Pos );
524+ float weight = 1 .f / i ->position ().distance_to ((*I).Pos );
527525 cumulative_weight += weight;
528- cover_pairs.push_back (std::make_pair (weight, * i));
526+ cover_pairs.push_back (std::make_pair (weight, i));
529527 }
530528 }
531529
@@ -552,20 +550,18 @@ void compute_non_covers()
552550 (*I).low_cover [j] = 0 .f ;
553551 }
554552
555- COVER_PAIRS::const_iterator i = cover_pairs.begin ();
556- COVER_PAIRS::const_iterator e = cover_pairs.end ();
557- for (; i != e; ++i)
553+ for (auto &i : cover_pairs)
558554 {
559- vertex& current = g_nodes[(*i) .second ->level_vertex_id ()];
560- float factor = (*i) .first / cumulative_weight;
555+ vertex& current = g_nodes[i .second ->level_vertex_id ()];
556+ float factor = i .first / cumulative_weight;
561557 for (int j = 0 ; j < 4 ; ++j)
562558 {
563559 (*I).high_cover [j] += factor * current.high_cover [j];
564560 (*I).low_cover [j] += factor * current.low_cover [j];
565561 }
566562 }
567563
568- for (int i2 = 0 ; i2 < 4 ; ++i )
564+ for (int i2 = 0 ; i2 < 4 ; ++i2 )
569565 {
570566 clamp ((*I).high_cover [i2], 0 .f , 1 .f );
571567 clamp ((*I).low_cover [i2], 0 .f , 1 .f );
0 commit comments