[vala/wip/housekeeping: 2/4] codegen: Simplify get_signal_canonical_constant()
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/housekeeping: 2/4] codegen: Simplify get_signal_canonical_constant()
- Date: Thu, 3 Nov 2016 18:38:12 +0000 (UTC)
commit aa0e857e9ae247f4679f517f5e19b7cb19c2f03d
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Nov 2 20:46:50 2016 +0100
codegen: Simplify get_signal_canonical_constant()
codegen/valaccodebasemodule.vala | 24 +-----------------------
1 files changed, 1 insertions(+), 23 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index e9a1c31..ab2e496 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -6419,29 +6419,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
public CCodeConstant get_signal_canonical_constant (Signal sig, string? detail = null) {
- var str = new StringBuilder ("\"");
-
- string i = get_ccode_name (sig);
-
- while (i.length > 0) {
- unichar c = i.get_char ();
- if (c == '_') {
- str.append_c ('-');
- } else {
- str.append_unichar (c);
- }
-
- i = i.next_char ();
- }
-
- if (detail != null) {
- str.append ("::");
- str.append (detail);
- }
-
- str.append_c ('"');
-
- return new CCodeConstant (str.str);
+ return new CCodeConstant ("\"%s%s\"".printf (get_ccode_name (sig).replace ("_", "-"), (detail
!= null ? "::%s".printf (detail) : "")));
}
public static CCodeConstant get_enum_value_canonical_cconstant (EnumValue ev) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]