[vala] codegen: put exception checks inside of a G_UNLIKELY
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: put exception checks inside of a G_UNLIKELY
- Date: Tue, 27 May 2014 08:30:36 +0000 (UTC)
commit c9a152d16f4742d95d04d9aa2031c8fe6447c102
Author: Evan Nemerson <evan nemerson com>
Date: Sat May 24 15:08:57 2014 -0700
codegen: put exception checks inside of a G_UNLIKELY
Fixes bug 730702
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]