Very stupid code question regarding millis()

Would it help if I put in some redundant curly-brackets?

boolean matches(int a[4], int b[4])
{
  for (int i = 0; i < 4; i++)
  {
    if (a[i] != b[i])
    {
      return false;
    }
  }
      
  return true;
}

And turned the 'for' loop into a 'while' loop?

boolean matches(int a[4], int b[4])
{
  int i = 0;
  while ( i < 4)
  {
    if (a[i] != b[i])
    {
      return false;
    }

    i++;
  }
      
  return true;
}

And use just basic integer operations?

int matches(int a[4], int b[4])
{
  int i = 0;
  while ( i < 4)
  {
    if (a[i] != b[i])
    {
      return 0;
    }

    i = i + 1;
  }
      
  return 1;
}
1 Like