I have a case where a seemingly simple function is taking up much more program space than I would expect. I have the following function in a much larger program (This obviously doesn’t do anything because I pared it down to try to isolate the source of the problem):

```
int get_fingers() {
int n = 0;
for (byte i = 0; i < 9; i++) {
bitSet(n, i);
bitClear(n, i);
}
return n;
}
```

Using that version of the function my sketch compiles to 22792 bytes.

However, using this version, which does the same thing, compiles to 21780, considerably smaller:

```
int get_fingers() {
int n = 0;
bitSet(n, 0);
bitClear(n, 0);
bitSet(n, 1);
bitClear(n, 1);
bitSet(n, 2);
bitClear(n, 2);
bitSet(n, 3);
bitClear(n, 3);
bitSet(n, 4);
bitClear(n, 4);
bitSet(n, 5);
bitClear(n, 5);
bitSet(n, 6);
bitClear(n, 6);
bitSet(n, 7);
bitClear(n, 7);
bitSet(n, 8);
bitClear(n, 8);
return n;
}
```

However, if I try these both in a bare minimum sketch, they compile to exactly the same size, as would be expected. I’m not changing anything else in my larger sketch, so do you have any ideas what could be going on with the compiler to make this much difference? Thanks!