diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index c7b6a92f24..334c9df62a 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #define MAX_INCLUDE_DEPTH 16 @@ -54,7 +53,6 @@ struct config_entry_list /* If we got this from an #include, * do not allow overwrite. */ bool readonly; - uint32_t key_hash; char *key; char *value; @@ -313,11 +311,11 @@ static bool parse_line(config_file_t *conf, key[idx++] = *line++; } - key[idx] = '\0'; - list->key = key; - list->key_hash = djb2_calculate(key); + key[idx] = '\0'; + list->key = key; + + list->value = extract_value(line, true); - list->value = extract_value(line, true); if (!list->value) { list->key = NULL; @@ -378,7 +376,6 @@ static config_file_t *config_file_new_internal( } list->readonly = false; - list->key_hash = 0; list->key = NULL; list->value = NULL; list->next = NULL; @@ -510,7 +507,6 @@ config_file_t *config_file_new_from_string(const char *from_string) } list->readonly = false; - list->key_hash = 0; list->key = NULL; list->value = NULL; list->next = NULL; @@ -545,17 +541,12 @@ config_file_t *config_file_new(const char *path) static struct config_entry_list *config_get_entry(const config_file_t *conf, const char *key, struct config_entry_list **prev) { - struct config_entry_list *entry; - struct config_entry_list *previous = NULL; - - uint32_t hash = djb2_calculate(key); - - if (prev) - previous = *prev; + struct config_entry_list *entry = NULL; + struct config_entry_list *previous = prev ? *prev : NULL; for (entry = conf->entries; entry; entry = entry->next) { - if (hash == entry->key_hash && string_is_equal(key, entry->key)) + if (string_is_equal(key, entry->key)) return entry; previous = entry; @@ -775,7 +766,6 @@ void config_set_string(config_file_t *conf, const char *key, const char *val) return; entry->readonly = false; - entry->key_hash = 0; entry->key = strdup(key); entry->value = strdup(val); entry->next = NULL; diff --git a/libretro-common/include/streams/file_stream.h b/libretro-common/include/streams/file_stream.h index c1b6fe951a..be380f0fc6 100644 --- a/libretro-common/include/streams/file_stream.h +++ b/libretro-common/include/streams/file_stream.h @@ -100,11 +100,6 @@ int filestream_printf(RFILE *stream, const char* format, ...); int filestream_error(RFILE *stream); -/* DO NOT put these functions back, unless you want to deal with - the UNAVOIDABLE REGRESSIONS on platforms using unexpected rfile backends -int filestream_get_fd(RFILE *stream); -FILE* filestream_get_fp(RFILE *stream); */ - int filestream_flush(RFILE *stream); static INLINE char *filestream_getline(RFILE *stream)