[vala/staging] codegen: put exception checks inside of a G_UNLIKELY



commit 05eba774d729e441058b72ed6bf7358611b1332d
Author: Evan Nemerson <evan nemerson com>
Date:   Sat May 24 15:08:57 2014 -0700

    codegen: put exception checks inside of a G_UNLIKELY

 codegen/valagerrormodule.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala
index 23d11a3..8b7ea10 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -171,7 +171,9 @@ public class Vala.GErrorModule : CCodeDelegateModule {
                        // eliminates C warnings
                } else {
                        var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, inner_error, 
new CCodeConstant ("NULL"));
-                       ccode.open_if (ccond);
+                       var unlikely = new CCodeFunctionCall (new CCodeIdentifier ("G_UNLIKELY"));
+                       unlikely.add_argument (ccond);
+                       ccode.open_if (unlikely);
                }
 
                if (current_try != null) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]