diff options
author | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
commit | 71f0ed8b7499011b53f90998ebfbd3250fd80948 (patch) | |
tree | e9c2f66fbef231858f46d878864199d46e6ce21c /src/ReplayGainInfo.hxx | |
parent | ac2e4e593d407e41db49fdb9ae2da6bc1557f618 (diff) |
*: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
Diffstat (limited to 'src/ReplayGainInfo.hxx')
-rw-r--r-- | src/ReplayGainInfo.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ReplayGainInfo.hxx b/src/ReplayGainInfo.hxx index 413e2fb1d..4cdbbc0c6 100644 --- a/src/ReplayGainInfo.hxx +++ b/src/ReplayGainInfo.hxx @@ -40,23 +40,23 @@ struct ReplayGainTuple { } gcc_pure - float CalculateScale(const ReplayGainConfig &config) const; + float CalculateScale(const ReplayGainConfig &config) const noexcept; }; struct ReplayGainInfo { ReplayGainTuple track, album; - constexpr bool IsDefined() const { + constexpr bool IsDefined() const noexcept { return track.IsDefined() || album.IsDefined(); } - const ReplayGainTuple &Get(ReplayGainMode mode) const { + const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept { return mode == ReplayGainMode::ALBUM ? (album.IsDefined() ? album : track) : (track.IsDefined() ? track : album); } - void Clear() { + void Clear() noexcept { track.Clear(); album.Clear(); } |