replace list with vector (makes no diff)

This commit is contained in:
Proddy
2024-02-04 14:49:59 +01:00
parent 40a685aeb2
commit 22b70ac378
3 changed files with 13 additions and 7 deletions

View File

@@ -32,8 +32,9 @@
class SecuritySettings {
public:
String jwtSecret;
std::list<User> users;
String jwtSecret;
std::vector<User> users;
// std::list<User> users;
static void read(SecuritySettings & settings, JsonObject root) {
// secret

View File

@@ -4,6 +4,7 @@
#include <Arduino.h>
#include <ArduinoJson.h>
#include <vector>
#include <list>
#include <functional>
#include <freertos/FreeRTOS.h>
@@ -128,8 +129,9 @@ class StatefulService {
}
private:
SemaphoreHandle_t _accessMutex;
std::list<StateUpdateHandlerInfo_t> _updateHandlers;
SemaphoreHandle_t _accessMutex;
std::vector<StateUpdateHandlerInfo_t> _updateHandlers;
// std::list<StateUpdateHandlerInfo_t> _updateHandlers;
};
#endif

View File

@@ -43,7 +43,8 @@ class CustomEntityItem {
class WebCustomEntity {
public:
std::list<CustomEntityItem> customEntityItems;
std::vector<CustomEntityItem> customEntityItems;
// std::list<CustomEntityItem> customEntityItems;
static void read(WebCustomEntity & webEntity, JsonObject root);
static StateUpdateResult update(JsonObject root, WebCustomEntity & webEntity);
@@ -78,8 +79,10 @@ class WebCustomEntityService : public StatefulService<WebCustomEntity> {
HttpEndpoint<WebCustomEntity> _httpEndpoint;
FSPersistence<WebCustomEntity> _fsPersistence;
std::list<CustomEntityItem> * customEntityItems; // pointer to the list of entity items
bool ha_registered_ = false;
std::vector<CustomEntityItem> * customEntityItems; // pointer to the list of entity items
// std::list<CustomEntityItem> * customEntityItems; // pointer to the list of entity items
bool ha_registered_ = false;
};
} // namespace emsesp