[gnome-calculator/wip/ricotz/gcalc: 5/7] gcalc: Remove superfluous casts in ExpressionHashMap



commit ba7375e7d0cdbfbffa3739223033e6889c605081
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Oct 7 20:05:28 2019 +0200

    gcalc: Remove superfluous casts in ExpressionHashMap

 gcalc/gcalc-expression-hash-map.vala | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gcalc/gcalc-expression-hash-map.vala b/gcalc/gcalc-expression-hash-map.vala
index 06e8a793..913562e9 100644
--- a/gcalc/gcalc-expression-hash-map.vala
+++ b/gcalc/gcalc-expression-hash-map.vala
@@ -20,17 +20,20 @@
  */
 public class GCalc.ExpressionHashMap : Gee.HashMap<uint,Expression> {
   public weak Expression parent { get; set; }
+
   public void add (Expression exp)
     requires (exp is Hashable)
   {
-    (this as Gee.HashMap<uint,Expression>).set (((Hashable) exp).hash (), exp);
+    @set (((Hashable) exp).hash (), exp);
     exp.parent = parent;
   }
+
   public void remove (Expression exp) {
-    (this as Gee.HashMap<uint,Expression>).unset (((Hashable) exp).hash ());
+    unset (((Hashable) exp).hash ());
   }
-  public Expression find_named (string name) {
-    return (this as Gee.HashMap<uint,Expression>).@get (name.hash ());
+
+  public Expression? find_named (string name) {
+    return @get (name.hash ());
   }
 }
 


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