From d3f7046a083623d0e3788af00fc7006eee45fa3f Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Fri, 4 Oct 2024 13:47:38 +0200 Subject: transient: improve field-dot-to-array --- lisp/mastodon-transient.el | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el index 4929a42..481a68e 100644 --- a/lisp/mastodon-transient.el +++ b/lisp/mastodon-transient.el @@ -69,18 +69,7 @@ the inner key part." (defun mastodon-transient-field-dot-to-array (key) "Convert KEY from tp dot annotation to array[key] annotation." - (let* ((split (split-string key "\\.")) - (count (length split))) - (cond ((not key) nil) - ((= 1 count) key) - (t - (concat ;; first item - (car split) - "_attributes" - ;; but last item - "[" (car (last split (1- count))) - ;; last item: - "][" (car (last split)) "]"))))) + (tp-dot-to-array key nil "_attributes")) (defun mastodon-transient-dot-fields-to-arrays (alist) "Parse fields ALIST in dot notation to array notation." -- cgit v1.2.3