*: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to consider these functions throwing.
This commit is contained in:
@@ -93,7 +93,7 @@ NeighborGlue::Close()
|
||||
}
|
||||
|
||||
NeighborGlue::List
|
||||
NeighborGlue::GetList() const
|
||||
NeighborGlue::GetList() const noexcept
|
||||
{
|
||||
List result;
|
||||
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
* plugins.
|
||||
*/
|
||||
gcc_pure
|
||||
List GetList() const;
|
||||
List GetList() const noexcept;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -36,7 +36,7 @@ const NeighborPlugin *const neighbor_plugins[] = {
|
||||
};
|
||||
|
||||
const NeighborPlugin *
|
||||
GetNeighborPluginByName(const char *name)
|
||||
GetNeighborPluginByName(const char *name) noexcept
|
||||
{
|
||||
for (auto i = neighbor_plugins; *i != nullptr; ++i)
|
||||
if (strcmp((*i)->name, name) == 0)
|
||||
|
@@ -32,6 +32,6 @@ extern const NeighborPlugin *const neighbor_plugins[];
|
||||
|
||||
gcc_pure
|
||||
const NeighborPlugin *
|
||||
GetNeighborPluginByName(const char *name);
|
||||
GetNeighborPluginByName(const char *name) noexcept;
|
||||
|
||||
#endif
|
||||
|
@@ -169,7 +169,7 @@ ReadServers(NeighborExplorer::List &list, const char *uri)
|
||||
|
||||
gcc_pure
|
||||
static NeighborExplorer::List
|
||||
DetectServers()
|
||||
DetectServers() noexcept
|
||||
{
|
||||
NeighborExplorer::List list;
|
||||
const std::lock_guard<Mutex> protect(smbclient_mutex);
|
||||
@@ -181,7 +181,7 @@ gcc_pure
|
||||
static NeighborExplorer::List::const_iterator
|
||||
FindBeforeServerByURI(NeighborExplorer::List::const_iterator prev,
|
||||
NeighborExplorer::List::const_iterator end,
|
||||
const std::string &uri)
|
||||
const std::string &uri) noexcept
|
||||
{
|
||||
for (auto i = std::next(prev); i != end; prev = i, i = std::next(prev))
|
||||
if (i->uri == uri)
|
||||
|
Reference in New Issue
Block a user