st/nine: Simplify ARG_BIND_REF
authorAxel Davy <axel.davy@ens.fr>
Sat, 3 Dec 2016 16:52:12 +0000 (17:52 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:47:08 +0000 (23:47 +0100)
Remove some noop operations.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/nine_csmt_helper.h

index a4987253bc6bebe0ed09bdfc29f1d3ab5a1de552..b0bbc054fc355918336f2338ed729d3d88180476 100644 (file)
@@ -346,16 +346,12 @@ name##_priv( struct NineDevice9 *device ARGS_FOR_DECLARATION( __VA_ARGS__ ) )
 
 #define ARG_BIND_REF(x, y) \
         x * _##y ,\
-        args->_##y = NULL; \
-        if (args->_##y != y && args->_##y) \
-            NineUnknown_Unbind((void *)(args->_##y)); \
-        if ( args->_##y != y && y ) \
+        if ( y ) \
             NineUnknown_Bind( (void *)y ); \
-        if ( args->_##y != y ) \
-            args->_##y = y ; ,\
+        args->_##y = y ; ,\
         x *y ,\
         args->_##y,\
-        if (args->_##y != NULL && args->_##y) \
+        if (args->_##y) \
             NineUnknown_Unbind((void *)(args->_##y)); \
         args->_##y = NULL; ,\
         ,\