void func(int* vec, int size, int x, int y, int value) { if (x * y < size) { vec[x * y] = value; } }
void func_optimized(int* vec, int size, int x, int y, int value) { int temp; temp = x * y; if (temp < size) { vec[temp] = value; } }