diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-12-22 09:16:52 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-12-22 09:16:52 +0100 |
commit | b2ef0ed8d2c37a813f9ad8b35c7a7e4a1d639e1c (patch) | |
tree | c6e10da018379be6b67f6118c5e6f15189f77a3b /vala | |
parent | 73cd47c7c474d4601766a10e413e4e7512b810f2 (diff) | |
download | vala-b2ef0ed8d2c37a813f9ad8b35c7a7e4a1d639e1c.tar.gz |
Make more use of native GLib.Regex syntax
Diffstat (limited to 'vala')
-rw-r--r-- | vala/valareport.vala | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/vala/valareport.vala b/vala/valareport.vala index 3d3a95fc8..9665c2d11 100644 --- a/vala/valareport.vala +++ b/vala/valareport.vala @@ -106,8 +106,6 @@ public class Vala.Report { public bool enable_warnings { get; set; default = true; } - static GLib.Regex val_regex; - /** * Set all colors by string * @@ -116,12 +114,7 @@ public class Vala.Report { * }}} */ public bool set_colors (string str, Report.Colored colored_output = Report.Colored.AUTO) { - try { - if (val_regex == null) - val_regex = new Regex ("^\\s*[0-9]+(;[0-9]*)*\\s*$"); - } catch (RegexError e) { - assert_not_reached (); - } + unowned Regex val_regex = /^\\s*[0-9]+(;[0-9]*)*\\s*$/; string error_color = null; string warning_color = null; |