[Mesa-dev] [PATCH 02/14] mesa: remove redundant byte swap check

Brian Paul brianp at vmware.com
Thu Jan 26 19:04:08 PST 2012


The outer conditional already did the test.
---
 src/mesa/main/pack.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index f874ab2..1712003 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -2020,14 +2020,10 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
    if (dstPacking->SwapBytes) {
       GLint swapSize = _mesa_sizeof_packed_type(dstType);
       if (swapSize == 2) {
-         if (dstPacking->SwapBytes) {
-            _mesa_swap2((GLushort *) dstAddr, n * comps);
-         }
+         _mesa_swap2((GLushort *) dstAddr, n * comps);
       }
       else if (swapSize == 4) {
-         if (dstPacking->SwapBytes) {
-            _mesa_swap4((GLuint *) dstAddr, n * comps);
-         }
+         _mesa_swap4((GLuint *) dstAddr, n * comps);
       }
    }
 
-- 
1.7.1



More information about the mesa-dev mailing list