/* Check if the state reference is already in the list */
for (index = 0; index < (GLint) paramList->NumParameters; index++) {
- GLuint i, match = 0;
- for (i = 0; i < STATE_LENGTH; i++) {
- if (paramList->Parameters[index].StateIndexes[i] == stateTokens[i]) {
- match++;
- }
- else {
- break;
- }
- }
- if (match == STATE_LENGTH) {
- /* this state reference is already in the parameter list */
- return index;
+ if (!memcmp(paramList->Parameters[index].StateIndexes,
+ stateTokens, STATE_LENGTH * sizeof(gl_state_index))) {
+ return index;
}
}