Add final specifier to classes

This allow compilers to generate more efficient code.
This commit is contained in:
Chocobo1
2020-04-17 12:37:53 +08:00
parent 2681093d27
commit d3d3f7dbb3
15 changed files with 19 additions and 19 deletions

View File

@@ -35,7 +35,7 @@
class QDataStream;
class FilterParserThread : public QThread
class FilterParserThread final : public QThread
{
Q_OBJECT

View File

@@ -31,7 +31,7 @@
#include <libtorrent/extensions.hpp>
#include <libtorrent/version.hpp>
class NativeSessionExtension : public lt::plugin
class NativeSessionExtension final : public lt::plugin
{
#if (LIBTORRENT_VERSION_NUM >= 10200)
lt::feature_flags_t implemented_features() override;

View File

@@ -32,7 +32,7 @@
#include <libtorrent/torrent_handle.hpp>
#include <libtorrent/version.hpp>
class NativeTorrentExtension : public lt::torrent_plugin
class NativeTorrentExtension final : public lt::torrent_plugin
{
public:
explicit NativeTorrentExtension(const lt::torrent_handle &torrentHandle);

View File

@@ -44,7 +44,7 @@ using LTPortMapping = int;
using LTPortMapping = lt::port_mapping_t;
#endif
class PortForwarderImpl : public Net::PortForwarder
class PortForwarderImpl final : public Net::PortForwarder
{
Q_OBJECT
Q_DISABLE_COPY(PortForwarderImpl)

View File

@@ -48,7 +48,7 @@ namespace BitTorrent
QStringList urlSeeds;
};
class TorrentCreatorThread : public QThread
class TorrentCreatorThread final : public QThread
{
Q_OBJECT

View File

@@ -70,7 +70,7 @@ namespace BitTorrent
// *Basic* Bittorrent tracker implementation
// [BEP-3] The BitTorrent Protocol Specification
// also see: https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol
class Tracker : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
class Tracker final : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
{
Q_OBJECT
Q_DISABLE_COPY(Tracker)