added comments as explanation
@ -310,8 +310,8 @@ namespace SixLabors.ImageSharp.Formats.Bmp
}
else
{
int max = cmd[0] + count;
byte cmd1 = cmd[1];
int max = count + cmd[0]; // as we start at the current count in the following loop, max is count + cmd[0]
byte cmd1 = cmd[1]; // store the value to avoid the repeated indexer access inside the loop
for (; count < max; count++)