aboutsummaryrefslogtreecommitdiff
path: root/include/components.h
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-10-13 01:13:12 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2022-10-13 01:13:12 +0300
commitf2c1beb5c3139238a3570d8f5052635519367d26 (patch)
tree3fead62d792b67b98f7c3396553427a51aa72e79 /include/components.h
parent896f8585ee8661ccea918d8f30007dc9b513eb39 (diff)
downloadrevela-f2c1beb5c3139238a3570d8f5052635519367d26.tar.gz
revela-f2c1beb5c3139238a3570d8f5052635519367d26.zip
Switch to vector + qsort instead of bst
Doesn't improve perfomance that much (sorting is far from the hotspot), but I realized that I didn't really need a BST for this use-case and I felt dumb for using one :/
Diffstat (limited to 'include/components.h')
-rw-r--r--include/components.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/components.h b/include/components.h
index f08d79a..4317187 100644
--- a/include/components.h
+++ b/include/components.h
@@ -68,11 +68,11 @@ struct album {
char year[8];
/* The date of the album is the date of the earliest image */
time_t tstamp;
- /*
- * Binary search tree with the images of this album sorted by date from
+ /*
+ * List/vector with the images of this album to be sorted by from
* older to newer.
*/
- struct bstree *images;
+ struct vector *images;
/* Files/dirs that belong to images and which shouldn't be deleted */
struct hmap *preserved;
/* Reference counted hashmap with values to be passed to the template */
@@ -92,7 +92,7 @@ struct image *image_old(struct stat *istat);
int image_cmp(const void *a, const void *b);
-void image_destroy(void *data);
+void image_destroy(struct image *);
struct album *album_new(struct album_config *, struct site *,
const char *src, const char *rsrc, const struct stat *);
@@ -103,6 +103,6 @@ void album_add_image(struct album *, struct image *);
void album_set_year(struct album *);
-void album_destroy(void *data);
+void album_destroy(struct album *);
#endif