dav/db.c

changeset 550
8c700eae3eb8
parent 541
e59a989d890d
child 552
e1a12762bf0a
--- a/dav/db.c	Sat Apr 06 14:25:07 2019 +0200
+++ b/dav/db.c	Sun Apr 07 09:07:33 2019 +0200
@@ -663,3 +663,18 @@
     }
     free(part);
 }
+
+UcxMap* create_hash_index(SyncDatabase *db) {
+    UcxMap *hmap = ucx_map_new(db->resources->count + 64);
+    
+    UcxMapIterator i = ucx_map_iterator(db->resources);
+    UcxKey key;
+    LocalResource *res;
+    UCX_MAP_FOREACH(key, res, i) {
+        if(res->hash) {
+            ucx_map_cstr_put(hmap, res->hash, res);
+        }
+    }
+    
+    return hmap;
+}

mercurial