fix(linked list): added missing const to function parameters

This commit is contained in:
Mineplay 2025-04-26 07:35:47 -05:00
parent c7b866ce1d
commit 22e9d69ced
3 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
Build Build
compile_commands.json compile_commands.json
.cache

View file

@ -51,7 +51,7 @@ FledastyError fledasty_linked_list_insert_after_value(FledastyLinkedList *curren
FledastyError fledasty_linked_list_remove_at_index(FledastyLinkedList *current_linked_list, const size_t index); FledastyError fledasty_linked_list_remove_at_index(FledastyLinkedList *current_linked_list, const size_t index);
FledastyError fledasty_linked_list_remove_value(FledastyLinkedList *current_linked_list, void *value); FledastyError fledasty_linked_list_remove_value(FledastyLinkedList *current_linked_list, void *value);
bool fledasty_linked_list_has_value(FledastyLinkedList *current_linked_list, void *value); bool fledasty_linked_list_has_value(const FledastyLinkedList *current_linked_list, void *value);
static inline bool fledasty_linked_list_is_empty(FledastyLinkedList *current_linked_list) { return current_linked_list->size == 0; } static inline bool fledasty_linked_list_is_empty(const FledastyLinkedList *current_linked_list) { return current_linked_list->size == 0; }
#endif #endif

View file

@ -22,7 +22,6 @@
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
#include "../../Include/Fledasty/Core/LinkedList.h" #include "../../Include/Fledasty/Core/LinkedList.h"
#include "Fledasty/Utils/Error.h"
#include <Hallocy/Core/Allocator.h> #include <Hallocy/Core/Allocator.h>
#include <Hallocy/Core/Memory.h> #include <Hallocy/Core/Memory.h>
@ -273,7 +272,7 @@ FledastyError fledasty_linked_list_remove_value(FledastyLinkedList *current_link
return FLEDASTY_ERROR_NONE; return FLEDASTY_ERROR_NONE;
} }
bool fledasty_linked_list_has_value(FledastyLinkedList *current_linked_list, void *value) { bool fledasty_linked_list_has_value(const FledastyLinkedList *current_linked_list, void *value) {
if (current_linked_list == NULL || value == NULL) { if (current_linked_list == NULL || value == NULL) {
return false; return false;
} }