@@ -22,33 +22,33 @@ extern "C"
22
22
23
23
*outSize = internalSections.size ();
24
24
25
- auto sections = (ChartSectionInternal *)malloc (
25
+ auto * sections = (ChartSectionInternal *)malloc (
26
26
internalSections.size () * sizeof (ChartSectionInternal));
27
27
28
28
int i = 0 ;
29
29
30
- for (auto section = internalSections.begin ();
31
- section != internalSections.end (); section++)
30
+ for (auto &internalSection : internalSections)
32
31
{
33
- auto nameLength = section-> first .size () + 1 ;
32
+ auto nameLength = internalSection. first .size () + 1 ;
34
33
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 );
36
36
sections[i].name [nameLength - 1 ] = ' \0 ' ;
37
37
38
38
sections[i].lines = (KeyValuePairInternal *)malloc (
39
- section-> second .size () * sizeof (KeyValuePairInternal));
39
+ internalSection. second .size () * sizeof (KeyValuePairInternal));
40
40
41
- sections[i].lineCount = section-> second .size ();
41
+ sections[i].lineCount = internalSection. second .size ();
42
42
43
- for (auto j = 0 ; j < section-> second .size (); j += 1 )
43
+ for (auto j = 0 ; j < internalSection. second .size (); j += 1 )
44
44
{
45
- auto keyLength = section-> second [j].first .size () + 1 ;
45
+ auto keyLength = internalSection. second [j].first .size () + 1 ;
46
46
sections[i].lines [j].key = (char *)malloc (keyLength);
47
47
strncpy (sections[i].lines [j].key ,
48
- section-> second [j].first .c_str (), keyLength - 1 );
48
+ internalSection. second [j].first .c_str (), keyLength - 1 );
49
49
sections[i].lines [j].key [keyLength - 1 ] = ' \0 ' ;
50
50
51
- auto values = section-> second [j].second ;
51
+ auto values = internalSection. second [j].second ;
52
52
53
53
for (auto k = 0 ; k < values.size (); k += 1 )
54
54
{
0 commit comments