doc/manual/style: Do not use 'Yoda conditions'
[fw/openocd] / doc / manual / style.txt
index dad3bb440c3b7dd403a612cba89bfcf2b591293e..c3fcfd782d8dfd3246eefd4a66839d66a91dd66d 100644 (file)
@@ -135,13 +135,13 @@ should write statements like the following:
 @code
 // separate statements should be preferred
 result = foo();
-if (ERROR_OK != result)
+if (result != ERROR_OK)
        ...
 @endcode
 More directly, do @b not combine these kinds of statements:
 @code
 // Combined statements should be avoided
-if (ERROR_OK != (result = foo()))
+if ((result = foo()) != ERROR_OK)
        return result;
 @endcode