libidav/resource.c

branch
dav-2
changeset 889
42cdbf9bbd49
parent 886
da79af4baec8
--- a/libidav/resource.c	Tue Oct 14 21:02:26 2025 +0200
+++ b/libidav/resource.c	Sat Nov 08 23:06:11 2025 +0100
@@ -280,47 +280,6 @@
     return resource->href;
 }
 
-CxHashKey dav_resource_path_key(DavResource *res) {
-    CxHashKey key = { NULL, 0, 0 };
-    if(res && res->path) {
-        cxstring res_path = cx_str(res->path);
-        if(res_path.length > 0 && res_path.ptr[res_path.length-1] == '/') {
-            res_path.length--;
-        }
-        key = cx_hash_key(res_path.ptr, res_path.length);
-    }
-    return key;
-}
-
-CxTreeIterator dav_resource_iterator(DavResource *res) {
-    return cx_tree_iterator(res, FALSE, offsetof(DavResource, children), offsetof(DavResource, next));
-}
-
-CxTreeVisitor dav_resource_visitor(DavResource *res) {
-    return cx_tree_visitor(res, offsetof(DavResource, children), offsetof(DavResource, next));
-}
-
-CxMap* dav_resource_map(DavResource *res) {
-    CxMap *map = cxHashMapCreate(res->session->mp->allocator, CX_STORE_POINTERS, 16);
-    if(!map) {
-        return NULL;
-    }
-    CxTreeIterator i = dav_resource_iterator(res);
-    int error = 0;
-    cx_foreach(DavResource *, res, i) {
-        if(cxMapPut(map, res->path, res)) {
-            error = 1;
-        }
-    }
-    if(!error) {
-        cxMapRehash(map);
-        return map;
-    } else {
-        cxMapFree(map);
-        return NULL;
-    }
-}
-
 void resource_add_prop(DavResource *res, const char *ns, const char *name, DavXmlNode *val) {
     DavSession *sn = res->session;
     
@@ -1639,7 +1598,7 @@
             property->value = n->children ? dav_convert_xml(sn, n->children) : NULL;
             
             cxmutstr propkey = dav_property_key(property->ns->name, property->name);
-            cxMapPut(map, cx_hash_key_cxstr(propkey), property);
+            cxMapPut(map, propkey, property);
             cx_strfree(&propkey);
         }
         n = n->next;

mercurial