@@ -22,33 +22,33 @@ extern "C"
2222
2323 *outSize = internalSections.size ();
2424
25- auto sections = (ChartSectionInternal *)malloc (
25+ auto * sections = (ChartSectionInternal *)malloc (
2626 internalSections.size () * sizeof (ChartSectionInternal));
2727
2828 int i = 0 ;
2929
30- for (auto section = internalSections.begin ();
31- section != internalSections.end (); section++)
30+ for (auto &internalSection : internalSections)
3231 {
33- auto nameLength = section-> first .size () + 1 ;
32+ auto nameLength = internalSection. first .size () + 1 ;
3433 sections[i].name = (char *)malloc (nameLength);
35- strncpy (sections[i].name , section->first .c_str (), nameLength - 1 );
34+ strncpy (sections[i].name , internalSection.first .c_str (),
35+ nameLength - 1 );
3636 sections[i].name [nameLength - 1 ] = ' \0 ' ;
3737
3838 sections[i].lines = (KeyValuePairInternal *)malloc (
39- section-> second .size () * sizeof (KeyValuePairInternal));
39+ internalSection. second .size () * sizeof (KeyValuePairInternal));
4040
41- sections[i].lineCount = section-> second .size ();
41+ sections[i].lineCount = internalSection. second .size ();
4242
43- for (auto j = 0 ; j < section-> second .size (); j += 1 )
43+ for (auto j = 0 ; j < internalSection. second .size (); j += 1 )
4444 {
45- auto keyLength = section-> second [j].first .size () + 1 ;
45+ auto keyLength = internalSection. second [j].first .size () + 1 ;
4646 sections[i].lines [j].key = (char *)malloc (keyLength);
4747 strncpy (sections[i].lines [j].key ,
48- section-> second [j].first .c_str (), keyLength - 1 );
48+ internalSection. second [j].first .c_str (), keyLength - 1 );
4949 sections[i].lines [j].key [keyLength - 1 ] = ' \0 ' ;
5050
51- auto values = section-> second [j].second ;
51+ auto values = internalSection. second [j].second ;
5252
5353 for (auto k = 0 ; k < values.size (); k += 1 )
5454 {
0 commit comments