[gnome-calculator] Avoid empty body of conditional statement
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Avoid empty body of conditional statement
- Date: Thu, 23 Oct 2014 03:50:17 +0000 (UTC)
commit ab783953f152e87cd6888e6cfc4c70840c648f35
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Oct 22 21:28:59 2014 -0500
Avoid empty body of conditional statement
Vala is warning about this now, and it makes the code a bit harder to
read.
src/math-equation.vala | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/math-equation.vala b/src/math-equation.vala
index 1cf0dbd..d9441e3 100644
--- a/src/math-equation.vala
+++ b/src/math-equation.vala
@@ -684,13 +684,14 @@ public class MathEquation : Gtk.SourceBuffer
next_is_digit = next_char.isdigit ();
/* Ignore thousands separators */
- if (c == serializer.get_thousands_separator () && last_is_digit && next_is_digit)
- ;
- /* Substitute radix character */
- else if (c == serializer.get_radix () && (last_is_digit || next_is_digit))
- eq_text += ".";
- else
- eq_text += c.to_string ();
+ if (c != serializer.get_thousands_separator () || !last_is_digit || !next_is_digit)
+ {
+ /* Substitute radix character */
+ if (c == serializer.get_radix () && (last_is_digit || next_is_digit))
+ eq_text += ".";
+ else
+ eq_text += c.to_string ();
+ }
last_is_digit = is_digit;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]