mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 11:10:27 +01:00
mesa: Simplify a bit of _mesa_add_state_reference using memcmp.
This commit is contained in:
parent
6b0c79e058
commit
e310c22bb7
1 changed files with 3 additions and 12 deletions
|
|
@ -378,18 +378,9 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList,
|
|||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue