diff options
author | Chad Versace <[email protected]> | 2012-08-01 21:23:47 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-08-07 09:30:33 -0700 |
commit | a4bf68ca50da0ce291a464aec9b03a469ab2561a (patch) | |
tree | 48228cbcc200abb65e1aa8501142ae76183d802b /src/mesa/drivers/dri/common | |
parent | b2d428cb8d20e003b65769c7757a137406c671e6 (diff) |
dri: Simplify use of driConcatConfigs
If either argument to driConcatConfigs(a, b) is null or the empty list,
then simply return the other argument as the resultant list.
All callers were accomplishing that same behavior anyway. And each caller
accopmplished it with the same pattern. So this patch moves that external
pattern into the function.
Reviewed-by: <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r-- | src/mesa/drivers/dri/common/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 328f56b50d4..6d8cb4e29a6 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -409,6 +409,11 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, __DRIconfig **all; int i, j, index; + if (a == NULL || a[0] == NULL) + return b; + else if (b == NULL || b[0] == NULL) + return a; + i = 0; while (a[i] != NULL) i++; |