From 66f90b7ac685d9e1c79ca4c1075bbe69239f4681 Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Thu, 19 Jul 2018 21:14:07 +0200 Subject: simplify hotloader; get rid of local var and mark function inline (For readability reasons) --- src/hotload.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hotload.c b/src/hotload.c index 6e8ae02..854fd8e 100644 --- a/src/hotload.c +++ b/src/hotload.c @@ -66,7 +66,7 @@ resolve_symlink(char *file) return NULL; } -internal struct watched_file * +internal inline struct watched_file * hotloader_watched_file(struct hotloader *hotloader, char *absolutepath) { struct watched_file *result = NULL; @@ -88,8 +88,7 @@ internal FSEVENT_CALLBACK(hotloader_handler) struct watched_file *watch_info; for (unsigned index = 0; index < count; ++index) { - char *absolutepath = files[index]; - if ((watch_info = hotloader_watched_file(hotloader, absolutepath))) { + if ((watch_info = hotloader_watched_file(hotloader, files[index]))) { hotloader->callback(watch_info->absolutepath, watch_info->directory, watch_info->filename); } } -- cgit v1.2.3