Use references instead of pointers whenver possible

This commit is contained in:
Thomas Basler
2023-12-12 13:26:07 +01:00
parent 8fb43fedf8
commit e95afbf2cc
103 changed files with 305 additions and 302 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2022 Thomas Basler and others
* Copyright (C) 2022-2023 Thomas Basler and others
*/
#include "WebApi_maintenance.h"
@@ -9,11 +9,11 @@
#include "WebApi_errors.h"
#include <AsyncJson.h>
void WebApiMaintenanceClass::init(AsyncWebServer* server)
void WebApiMaintenanceClass::init(AsyncWebServer& server)
{
using std::placeholders::_1;
_server = server;
_server = &server;
_server->on("/api/maintenance/reboot", HTTP_POST, std::bind(&WebApiMaintenanceClass::onRebootPost, this, _1));
}