[dconf-editor] More readable code.



commit a61acde7cde5896f986e0a80d83a74543bb9e6bd
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Thu Jan 25 15:15:28 2018 +0100

    More readable code.

 editor/modifications-handler.vala |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/editor/modifications-handler.vala b/editor/modifications-handler.vala
index d2a41cc..94932be 100644
--- a/editor/modifications-handler.vala
+++ b/editor/modifications-handler.vala
@@ -28,21 +28,14 @@ public enum ModificationsMode {
     DELAYED
 }
 
-public uint key_hash (Key key)
-{
-    return str_hash (key.descriptor);
-}
-
-public bool key_equal (Key key1, Key key2)
-{
-    return str_equal (key1.descriptor, key2.descriptor);
-}
-
 class ModificationsHandler : Object
 {
     public ModificationsMode mode { get; set; default=ModificationsMode.NONE; }
 
-    private HashTable<Key, Variant?> keys_awaiting_hashtable = new HashTable<Key, Variant?> (key_hash, 
key_equal);
+    private HashTable<Key, Variant?> keys_awaiting_hashtable = new HashTable<Key, Variant?> (
+            (key)        => { return str_hash (key.descriptor); },
+            (key1, key2) => { return str_equal (key1.descriptor, key2.descriptor); }
+        );
     public uint dconf_changes_count
     {
         get


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